#include long F[5] = {3, 5, 17, 257, 65537}; int main() { long n; long ans = 0; std::cin >> n; for(long i = 0; i < 32; ++i) { long temp = 1; for(long j = 0; j < 5; ++j) { if( (i & (1 << j)) != 0 ) { temp *= F[j]; if( temp > n ) { break; } } } if( temp > n ) { continue; } for(;;) { if( temp <= n ) { if( temp >= 3 ) { ans += 1; } temp *= 2; } else { break; } } } std::cout << ans << std::endl; return 0; }