#include <bits/stdc++.h>
int main() {
  char s[2 * 100000 + 1];
  int i;
  i = 0;
  int len;
  while (i < 2 * 100000 + 1) {
    i++;
    s[i] = '\0';
  }
  len = i;
  scanf("%s", &s);
  int cnt;
  cnt = 0;
  i = 0;
  int f;
  f = 0;
  char prev;
  prev = ' ';
  while (i < len) {
    if (f == 1 || s[i] != prev) {
      f = 0;
    } else if (i == len - 1 && s[i] == s[i - 1])
      cnt--;
    else {
      f = 1;
      i++;
    }
    cnt++;
    i++;
    prev = s[i];
  }
  printf("%d\n", cnt);
}
