#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  ll ans = 0;
  reverse(S.begin(), S.end());
  int len = S.size();
  int c = 1;
  char prev = '\0';
  for (int i = 0; i < len; ++i) {
    if (i < len - 1 && prev == S[i]) {
      c++;
    } else {
      ans++;
    }
    prev = S[i];
  }
  cout << ans;
  return 0;
}
