#include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int LongestConsecutiveCharacter(const std::string& s) {
// Write your logic here.
// Parameters:
// s (const std::string&): The passcode string consisting of lowercase alphabets
// Returns:
// int: Length of the longest part of the passcode that contains only one unique character
int n = s.length();
if (n==1) return 1;
int maxi = INT_MIN;
for (int i=0;i<n-1;i++) {
int cnt = 1;
while (s[i] == s[i+1]) {
cnt++;
if (cnt > maxi) {
maxi = cnt;
}
i++;
}
}
return maxi;
}
int main() {
std::string s;
std::getline(std::cin, s);
// Call user logic function and print the output
int result = LongestConsecutiveCharacter(s);
std::cout << result << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgTG9uZ2VzdENvbnNlY3V0aXZlQ2hhcmFjdGVyKGNvbnN0IHN0ZDo6c3RyaW5nJiBzKSB7CiAgICAvLyBXcml0ZSB5b3VyIGxvZ2ljIGhlcmUuCiAgICAvLyBQYXJhbWV0ZXJzOgogICAgLy8gICAgIHMgKGNvbnN0IHN0ZDo6c3RyaW5nJik6IFRoZSBwYXNzY29kZSBzdHJpbmcgY29uc2lzdGluZyBvZiBsb3dlcmNhc2UgYWxwaGFiZXRzCiAgICAvLyBSZXR1cm5zOgogICAgLy8gICAgIGludDogTGVuZ3RoIG9mIHRoZSBsb25nZXN0IHBhcnQgb2YgdGhlIHBhc3Njb2RlIHRoYXQgY29udGFpbnMgb25seSBvbmUgdW5pcXVlIGNoYXJhY3RlcgogICAgaW50IG4gPSBzLmxlbmd0aCgpOwogICAgaWYgKG49PTEpIHJldHVybiAxOwogICAgaW50IG1heGkgPSBJTlRfTUlOOwogICAgZm9yIChpbnQgaT0wO2k8bi0xO2krKykgewogICAgICAgIGludCBjbnQgPSAxOwogICAgICAgIHdoaWxlIChzW2ldID09IHNbaSsxXSkgewogICAgICAgICAg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