#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int ans = 0;
  bool jud = false;
  for (int i = 0; i < (S.size()); i++) {
    if (jud) {
      jud = false;
      break;
    }
    if (S[i] == S[i + 1]) {
      jud = true;
      break;
    }
    ans++;
  }
  cout << ans << endl;
}
