#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> S;
  N = S.length();
  int minus{};
  char prev{S[0]};
  for (int i{1}; i < N; ++i) {
    if (prev == S[i]) {
      ++minus;
    }
    prev = S[i];
  }
  cout << N - minus + 1 << endl;
  return 0;
}
