#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s, prev, str;
  int i, a, counter = 0;
  cin >> s;
  a = s.size();
  prev += s[0];
  for (i = 0; i < a;) {
    if (str.empty()) str += s[i];
    if (!str.compare(prev)) {
      i++;
      str += s[i];
    } else {
      counter++;
      prev = str;
      str.clear();
      i++;
    }
  }
  printf("%d\n", counter);
  return 0;
}
