#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
char s[N];
int n, ans, pos;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  ans = n;
  pos = 1;
  for (register int i = 2; i <= n; ++i)
    if (s[i] == s[pos])
      --ans, pos = i + 1, i += 2;
    else
      pos = i;
  return printf("%d", ans), 0;
}
