#include <bits/stdc++.h>
using namespace std;
int main() {
  string res;
  cin >> res;
  int sum = 0;
  auto it1 = res.begin();
  auto it2 = res.begin();
  while (++it2 != res.end()) {
    sum += *it1++ != *it2;
  }
  cout << sum << endl;
  return 0;
}
