#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 11;
string las, now;
char s[N];
int ans;
int main() {
  gets(s + 1);
  for (int i = 1; s[i]; ++i) {
    now += s[i];
    if (now != las) las = now, ++ans, now = "";
  }
  printf("%d\n", ans);
  return 0;
}
