#include <iostream>
void main()
{
  char a;
  char buf[10000];
  int k = 0;
  for (int p = 0; 1; p++) {
  	std::iostream::cin >> a;
    if (buf[p] != a) {
      	buf[p] = a;
        k++;
    	break;
    }
  }
  std::iostream::cout << k;
}