#include<bits/stdc++.h>
using namespace std;
int main(){
int i,n,h=0;
cin>>n;
for(i=1;i<=n;i++){
if(i<=99){
if(i%10==0){
h++;
}
}else{
if(i/10%10==0||i%10==0){
h++;
}
}
}
cout<<h;
}
/**************************************************************
Problem: 1750
User: linmiaoling
Language: C++
Result: Accepted
Time:9 ms
Memory:2072 kb
****************************************************************/