#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5;
int len;
char s[Maxn + 5];
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  int ans = 0;
  string last, now;
  for (int l = 1; l <= len;) {
    while (now == "" || now == last) now += s[l], l++;
    ans++, last = now, now = s[l + 1], l++;
  }
  printf("%d\n", ans);
  return 0;
}
