#include<iostream>
using namespace std;
bool check(int a)
{
int w=1;
while(a)
{
int r=a/10;
if(a%2!=w%2) return false;
a/=10,w++;
}
return true;
}
int main()
{
int n;
cin>>n;
int res=0;
for (int i = 1; i <= n; i ++ )
{
if(check(i)) res++;
}
cout<<res<<endl;
return 0;
}