#include <bits/stdc++.h>
using namespace std;
signed main() {
  int a = 0, e;
  string b;
  string c, d;
  cin >> b;
  c[0] = b[0];
  for (int i = 1; i < b.size(); i++) {
    d += b[i];
    if (c == d) {
      e = i;
      while (true) {
        e++;
        d += b[e];
        if (c != d) break;
      }
      i = e;
    }
    c = {};
    c = d;
    d = {};
    a++;
  }
  cout << a << "\n";
}
