#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, M, O, count = 0;
  string S;
  cin >> S;
  for (long long i = 0; i < S.size() - 1; i++) {
    if (S[i] == S[i + 1]) count++;
  }
  cout << S.size() - count + 1 << endl;
}
