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