#include <bits/stdc++.h>
using namespace std;

int main()
{
  string s;
  while(cin>>s){
   	int ans = 1, n = s.lenght();
	int i=0;
    while(i<n){
	  int j = i+1;
      int temp = i;
      while(j<n && s[j] != s[i]){
        ans = max(ans, j-temp);
        i = j++;
      }
    }
    cout<<ans<<endl;
  }
  return 0; 
}