#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char S[200000];
  scanf("%s", S);
  int length = strlen(S);
  int istwo = false, point = 1, answer = 1;
  while (point < length) {
    if (point == length - 1) {
      if (S[point] != S[point - 1]) {
        answer++;
      }
      break;
    }
    if (!istwo) {
      if (S[point] == S[point - 1]) {
        istwo = true;
        point += 2;
      } else {
        point++;
      }
    } else {
      point++;
      istwo = false;
    }
    answer++;
  }
  printf("%d\n", answer);
  return 0;
}
