#include <bits/stdc++.h>
int main() {
  char string[20007];
  char aux[20007];
  scanf("%s", string);
  int i, j = 0, cont = 0;
  for (i = 0; i < strlen(string); i++) {
    while (string[i] == string[i + 1]) {
      aux[j] = string[i];
      j++;
      i++;
    }
    cont++;
    j = 0;
    aux[j] = string[i + 1];
    j++;
  }
  printf("%d\n", cont + 1);
  return 0;
}
