#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n;
char s[MAXN];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  string last;
  int i = 1, ans = 0;
  while (i <= n) {
    string tmp;
    tmp += s[i++];
    if (tmp != last)
      ++ans;
    else {
      if (i + 1 <= n)
        tmp += s[i++], ++ans;
      else
        i = n + 1;
    }
    last = tmp;
  }
  printf("%d", ans);
  return 0;
}
