#include using namespace std; int main(){ int n; cin >> n; int i=0,j = n,l=j*10; while(j>9) { i++; j/=10; l/=10; } l%=10; //cout << n << ' ' << i << ' ' << j << ' ' << l << endl; int count; if(j==9) count =4; else if(j>=6) count = 3; else if(j>=3) count = 2; else count = 1; for(int k=0; k=1) count -= 4; else count=0; //cout << count << endl; int lim = min(n,99); for(int k=10; k<=lim; ++k) { if((k/10)%3!=0 && k%3==0 ) count ++; } cout << count << endl; }