#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
int n;
// 比如判断4327是不是好数
bool check(int x){
int cnt = 1;
while(x != 0){
int t = x % 10;
if(cnt % 2 == 1){
if(t % 2 == 0) return false;
}else{
if(t % 2 == 1) return false;
}
cnt ++;
x /= 10;
}
return true;
}
int main(){
cin >> n;
int cnt = 0;
for(int i=1;i<=n; i++)
if(check(i))
cnt++;
cout << cnt << endl;
return 0;
}