#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
string b;
while(t>0){
if(t%2==1)b+='1';
else b+='0';
t=t/2;
}
int count=0;
int j=0;
for(int i=0;i<b.size();i++){
if(b[i]=='1'){
count++;
}
else {
//
if(j<count)j=count;
count=0;
}
}
if(j<count) cout<<count; else cout<<j;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号