#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int l = S.length();
  string sub = S.substr(0, 1);
  int res = 0;
  for (int i = 0; i < l - 1; i++) {
    int j = 1;
    string ss = S.substr(i + 1, j);
    if (sub == ss) {
      while (sub == ss) {
        j++;
        ss = S.substr(i, j);
      }
      i += j - 1;
    }
    sub = ss;
    res++;
  }
  cout << res << endl;
  return 0;
}
