#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define llong long long vector fermi_primes{3, 5, 17, 257, 65537}; int main() { int a; cin >> a; vector cands; rep(i, 32) { bitset<5> bits(i); llong cand = 1; rep(j, 5) if(bits[j] == 1) cand*=fermi_primes[j]; cands.push_back(cand); } int limit = cands.size(); rep(i, limit) { int times = 2; while(true) { if(cands[i]*times > a) break; cands.push_back(cands[i]*times); times*=2; } } int result=0; rep(i, cands.size()) result += cands[i] <= a && cands[i] > 2; cout << result << "\n"; }