#include <bits/stdc++.h>
using namespace std;
bool check(int x){
int f = 1;
while(x){
if(x % 2 != f) return false;
x /= 10;
f = 1 - f;
}
return true;
}
int main(){
int ans = 0;
int n;
cin >> n;
for(int i = 1; i <= n; i += 2){
if(check(i)) ans ++;
}
cout << ans;
}