import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        char[] ch = str.toCharArray();
        int a = 1; int temp = 1;
        for (int i=0;i<ch.length-1;i++){
            if(ch[i]!= ch[i+1]){
                a++;
            }else {
                if(temp<=a){
                    temp = a;
                    a=1;
                }
            }
        }
        System.out.println(temp>a?temp:a);
    }
}