#include #include using lint = long long; std::vector ps{3, 5, 17, 257, 65537}; void solve() { lint n; std::cin >> n; int ans = 0; int m = ps.size(); for (int b = 0; b < (1 << m); ++b) { lint p = 1; for (int i = 0; i < m; ++i) { if ((b >> i) & 1) p *= ps[i]; } for (int k = 0;; ++k) { if ((1LL << k) * p >= n) break; ++ans; } } std::cout << ans - 2 << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }