include[HTML_REMOVED]
using namespace std;
bool check(int x){
int cnt=1;
while(x){
if((x%10)%2!=cnt%2)return false;
x/=10;
cnt;
}
return true;
}
int main(){
int n;
int ans=0;
cin>>n;
for(int i=1;i<=n;i){
if(check(i))ans++;
}
cout<<ans<<endl;
return 0;
}