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