#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
int main() {
  string s;
  cin >> s;
  int ans = 1;
  for (int i = 0; i + 1 < s.size(); i++)
    if (s[i] == s[i + 1]) ans++;
  cout << ans << endl;
}
