#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const long long MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(20);
  string s;
  cin >> s;
  int n = s.size();
  s += s;
  char c = 'w';
  int ans = 0;
  char prev = s[0] == 'w' ? 'b' : 'w';
  int cur = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (s[i] != prev)
      cur++;
    else
      cur = 1;
    prev = s[i];
    ans = max(ans, min(cur, n));
  }
  cout << ans << '\n';
  return 0;
}
