#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int ans(1);
  for (int i = 1; i < s.size(); i++) {
    if (s[i + 1] != s[i]) {
      ans++;
    } else {
      continue;
    }
  }
  cout << ans << endl;
}
