#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, c;
  while (!isdigit(c = getchar()))
    ;
  while (x = x * 10 + c - '0', isdigit(c = getchar()))
    ;
  return x;
}
char s[300005];
int n, ans, t;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  s[n + 1] = '0';
  ans = 1;
  for (int i = 2; i <= n;) {
    ans++;
    if (s[i] != s[i - 1] || t == 1)
      i++, t = 0;
    else
      i += 2, t = 1;
  }
  printf("%d\n", ans);
  return 0;
}
