#include <bits/stdc++.h>
int main() {
  int k = 0;
  char S[2 * 10 ^ 5];
  std::cin >> S;
  int i;
  for (i = 1; i++; i < sizeof(S)) {
    if (S[i - 1] != S[i]) {
      continue;
    } else {
      k++;
    }
  }
  std::cout << k;
  return 0;
}
