#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i = 0, cnt = 0;
  set<int> dic;
  string bef = " ";
  while (i < s.size()) {
    string cmp = " ";
    int v = 0;
    cmp += s[i];
    v += (int)s[i];
    if (i == s.size() - 1) {
      if (dic.count(v)) {
        break;
      }
    }
    if (bef == cmp) {
      i++;
      if (i == s.size() - 1) {
        cnt++;
        break;
      }
      cmp += s[i];
      v += (int)s[i];
    }
    bef = cmp;
    dic.insert(v);
    i++;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
