#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int main() { set ss; ll f[5] = {3, 5, 17, 257, 65537}; REP(s, 1<<5) { ll num = 1; REP(i, 5) if (s >> i & 1) num *= f[i]; if (num > 1e9) continue; REP(i, 32) { if (num * (1< 1e9) break; ss.insert(num * (1<> n; int ans = 0; for (set::iterator it = ss.begin(); it != ss.end(); ++it) { if (*it >= 3 && *it <= n) ans++; } cout << ans << endl; return 0; }