#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  s = s + s;
  int c = 1, max = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'b') {
      if (s[i + 1] == 'w') {
        c++;
      } else
        c = 1;
    } else {
      if (s[i + 1] == 'b') {
        c++;
      } else
        c = 1;
    }
    if (c > max) max = c;
  }
  if (max == n * 2) max = max / 2;
  cout << max;
}
