#include <bits/stdc++.h>
int main(void) {
  char S[200000], a = '\0';
  int i, count = 0;
  scanf("%s", S);
  for (i = 0; S[i] != '\0'; i++) {
    if (a != S[i]) {
      a = S[i];
      count++;
    } else
      a += S[i];
  }
  printf("%d\n", count);
  return 0;
}
