#include<bits/stdc++.h>
using namespace std;
bool good(int x){
int cnt=1;
int ans;
while(x){
cnt++;
ans=x%10;
x/=10;
if(cnt%2==0){
if(ans%2==0)return false;
else continue;
}
if(cnt%2==1){
if(ans%2==1)return false;
else continue;
}
}
return true;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
int cnt=0;
for(int i=1;i<=n;i++){
if(good(i)){
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
using namespace std;
bool good(int x){
int cnt=1;
int ans;
while(x){
cnt++;
ans=x%10;
x/=10;
if(cnt%2==0){
if(ans%2==0)return false;
else continue;
}
if(cnt%2==1){
if(ans%2==1)return false;
else continue;
}
}
return true;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin>>n;
int cnt=0;
for(int i=1;i<=n;i++){
if(good(i)){
cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
3 回复
0 转发
0 喜欢
17 阅读



