#include using namespace std; int main() { int p; cin >> p; cout << __builtin_popcount(2 * p - 1) << "\n"; }