#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  cin >> s;
  long long ans = 1;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] != s[i + 1]) ans++;
  }
  cout << ans << endl;
  return 0;
}
