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

int main() 
{
	string s;
	int c=1,max=1;
	cin>>s;
	for(int i=0;s[i]!='\0';i++)
	{
		if(s[i]==s[i+1])
		c++;
		else
		{
			if(max<c)
			max=c;
			c=1;
		}
	}
	cout<<c;
	// your code goes here
	return 0;
}