//https://ncode.syosetu.com/n4830bu/237/ #include using namespace std; using ll = long long; int main() { ll A; cin >> A; vector FermatPrimes{3, 5, 17, 257, 65537}; int ans = 0; for (int bit = 0; bit < 32; bit++) { ll prod = 1; for (int i = 0; i < 5; i++) { if (bit & (1 << i)) prod *= FermatPrimes[i]; } while (prod <= A) { ans++; prod *= 2; } } cout << ans - 2 << endl; }