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