#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;
}