#include<bits/stdc++.h>
#include<iostream>
#define ll long long
#define MOD 1e9+7
using namespace std;
int main(){
string str;
cin>>str;
ll max_length = 0;
ll i = 0;
while(i<str.size()){
ll j = i ;
while(j<str.size() && str[i]==str[j])j++;
max_length = max(max_length,(ll)j-i);
i = j;
}
cout<<max_length<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGU8aW9zdHJlYW0+CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgTU9EIDFlOSs3CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpewogICAgc3RyaW5nIHN0cjsKICAgIGNpbj4+c3RyOwogICAgbGwgbWF4X2xlbmd0aCA9IDA7CiAgICBsbCBpID0gMDsKICAgIHdoaWxlKGk8c3RyLnNpemUoKSl7CiAgICAgICAgbGwgaiA9IGkgOwogICAgICAgIHdoaWxlKGo8c3RyLnNpemUoKSAmJiBzdHJbaV09PXN0cltqXSlqKys7CiAgICAgICAgbWF4X2xlbmd0aCA9IG1heChtYXhfbGVuZ3RoLChsbClqLWkpOwogICAgICAgIGkgPSBqOwogICAgfQogICAgY291dDw8bWF4X2xlbmd0aDw8ZW5kbDsKICAgcmV0dXJuIDA7Cn0K