#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int ans = 0, cnt = 1;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] == s[i - 1])
      cnt++;
    else {
      if (cnt == 1)
        ans++;
      else
        ans += (cnt - 1);
      cnt = 1;
    }
  }
  if (cnt == 1)
    ans++;
  else
    ans += (cnt - 1);
  cout << ans;
  return 0;
}
