#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  long long b;
  cin >> s;
  for (long long i = 0; i < s.size() - 1; ++i) {
    if (s.at(i) == s.at(i + 1)) b++;
  }
  cout << b;
}
