#include #define two(x) x + x using namespace std; int main() { int num,i; int count = 0; int sum = 1; cin >> num; while (sum != num) { for (i = 0; i <= sum;i++) { if(two(sum - i) + i <= num){ count++; sum = two(sum - i) + i; break; } } } cout << count << endl; return 0; }