#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  uint32_t res = 1;
  char Prev = S[0];
  for (uint32_t i = 1; i < S.size(); ++i) {
    if (S[i] != Prev) {
      ++res;
      Prev = S[i];
    } else {
      Prev = 'A';
    }
  }
  cout << res << endl;
  return 0;
}
