#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  string preS = "A";
  string nowS;
  nowS = S[0];
  long count = 0;
  for (int i = 0; i < S.size(); i++) {
    if (preS != nowS) {
      preS = nowS;
      nowS = S[i];
      count++;
    } else {
      nowS += S[i];
    }
  }
  cout << count << endl;
  return 0;
}
