#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int sum = 0, len = str.size();
  bool judge = false;
  int i;
  sum++;
  for (i = 1; i < len - 1; i++) {
    if (str[i] == str[i - 1] && judge == false) {
      judge = true;
      sum++;
      i++;
    } else {
      judge = false;
      sum++;
    }
  }
  if (i == (len - 1)) {
    if (str[len - 2] == str[len - 1])
      ;
    else
      sum++;
  }
  printf("%d\n", sum);
  return 0;
}
