text: #include <bits/stdc++.h>
  using namespace std;
  typedef unsigned long long int ull;
  typedef long long int ll;
  typedef long double ld;
  #define Mod 1000000007
  #define Infinity (ll)1e18
  #define Append(a) push_back(a)
  #define Pair(a,b) make_pair(a,b)
  #define Clear(a) for(ll &x : a){x=0;}
  #define Point(x) std::fixed<<setprecision(15)<<x
  #define SetBits(x) __builtin_popcount(x);
  #define GoogleOutput(i,x) cout<<"Case #"<<i<<": "<<x<<'\n'
  #define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define BoolAnsCall(b) (cout<<(b?"Yes\n":"No\n"));
  #define Print(x) cout<<x
  #define Input(x) cin>>x
  
  
  int main(){
    FastIO;
    string dna;
    cin>>dna;
    int n = dna.length();
    vector<int>dp(n,1);
    int max_same = 1;
    for(int i = 1;i<n;i++){
      if(dna[i]==dna[i-1]) dp[i] = 1 + dp[i-1];
      max_same = max(max_same,dp[i]);
    }
    cout<<max_same;
    return 0;
  } 