#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count = 0;
  char k[100] = {};
  for (int i = 1; i <= sizeof(s); i++) {
    if (s.at(i - 1) == s.at(i)) {
      k[i] = s.at(i);
    }
    if (s.at(i - 1) != s.at(i)) {
      count++;
    }
  }
  cout << count << endl;
}
