#include using namespace std; int main(){ vector A; A.push_back(1); for (int i = 1; i < 25; i++){ long long X = ((long long) 5 << (i * 2 - 2)) - (1 << (i - 1)) ; A.push_back(X); } long long N; cin >> N; int M = 0; for (int i = 0; i < 25; i++){ if (A[i] < N){ M++; } } cout << N - M - 1 << endl; }