#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: linzihang
	Language: C++
	Result: Accepted
	Time:11 ms
	Memory:2072 kb
****************************************************************/