#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  string s, t1 = "", t2 = "";
  cin >> s;
  t1 += s[0];
  int cnt = 0;
  for (int i = 1; i < s.length(); ++i) {
    t2 += s[i];
    if (t1 != t2) {
      ++cnt, t1 = t2, t2 = "";
    }
  }
  printf("%d\n", cnt);
  return 0;
}
