#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n;
char s[maxn];
int myabs(int a) { return a > 0 ? a : -a; }
int main() {
  scanf("%s", s);
  n = strlen(s);
  int an = 0;
  int las = -1;
  int now = 0;
  while (now < n - 1) {
    if (s[now] == las) {
      ++an;
      las = -s[now];
      now += 2;
    } else {
      ++an;
      las = s[now];
      now += 1;
    }
  }
  if (myabs(las) != s[n - 1]) ++an;
  printf("%d\n", an);
  return 0;
}
