#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int sum = 0, maxx = 0;
  bool f1 = false, f2 = false;
  cin >> str;
  str += str;
  for (int i = 1; i < str.size(); i++) {
    if (str[i] == 'b') f1 = true;
    if (str[i] == 'w') f2 = true;
    if (str[i] != str[i - 1])
      sum++, maxx = max(sum + 1, maxx);
    else
      sum = 0;
  }
  if (maxx == str.size()) maxx /= 2;
  if (f1 && f2)
    printf("%d\n", maxx);
  else
    printf("1\n");
  return 0;
}
