#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int n;
while(cin >> n) {
int cnt = 0;
while(n) {
n = n&(n<<1);
cnt++;
}
cout << cnt << endl;
}
return 0;
}
京公网安备 11010502036488号