#include <bits/stdc++.h>
using namespace std;
char s[25];
int d[25];
int main(int argc, const char *argv[]) {
  scanf("%s", s + 1);
  int len = (int)strlen(s + 1);
  int *dp = &d[1];
  dp[-1] = -1;
  dp[0] = 0;
  dp[1] = 1;
  int i;
  for (i = 2; i <= len; i++) {
    if (s[i] == s[i - 1]) {
      dp[i] = dp[i - 3] + 2;
    } else {
      dp[i] = dp[i - 1] + 1;
    }
  }
  printf("%d\n", d[len + 1]);
  return 0;
}
