#include <bits/stdc++.h>
char a[200001];
int main() {
  int i, c = 1;
  scanf("%s", a);
  i = 1;
  while (a[i] != '\0') {
    if (a[i] == a[i - 1]) {
      i++;
      if (a[i] == '\0') break;
    }
    i++;
    c++;
  }
  printf("%d", c);
  return 0;
}
