#include #include #include #include #include #include using namespace std; const int SIZE = 5; int main() { int a; cin >> a; int nums[SIZE] = {3, 5, 17, 257, 65537}; int ans = 0; long long product; for (int i = (1 << SIZE) - 1; i >= 1; i--) { int tmp = i; product = 1; for (int j = 0; j < SIZE; j++) { if (tmp & (1 << j)) { product *= nums[j]; } } while (product <= a) { ans++; product <<= 1; } } product = 4; while (product <= a) { ans++; product <<= 1; } cout << ans << endl; return 0; }