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