// BCC /* #include #include #include #include #include #include */ // GCC #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--) #define each(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define chmin(a, b) a = min(a, b) #define chmax(a, b) a = max(a, b) #define pb push_back #define mp make_pair typedef long long ll; const int INF = 1 << 28; const ll INFLL = 1ll << 56; int main() { vector table = {3, 5, 17, 257, 65537}; vector v; ll a; scanf("%lld", &a); for (ll x = 1; x <= (ll)1e9; x <<= 1){ rep(bit, 1 << 5){ ll y = x; rep(i, 5){ if (bit & (1 << i)){ y *= table[i]; } } if (3 <= y && y <= a) v.pb(y); } } sort(begin(v), end(v)); v.erase(unique(begin(v), end(v)), end(v)); printf("%d\n", v.size()); }