#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  while (cin >> s) {
    int ans = 1, n = s.length();
    int i = 0;
    while (i < n) {
      int j = i + 1;
      while (j < n && s[j] != s[j - 1]) {
        ans = max(ans, j - i);
        j++;
      }
      i = j;
    }
    cout << ans << endl;
  }
  return 0;
}
