#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
int n, k;
char s[maxn];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  k = 0;
  int lst = 2;
  for (int i = 1; i <= n;) {
    if (lst == 1 && s[i - 1] == s[i]) {
      i += 2, lst = 2;
      if (i > n) k--;
    } else
      lst = 1, i++;
    k++;
  }
  printf("%d\n", k);
  return 0;
}
