#include <bits/stdc++.h>
using namespace std;
int main(void) {
  char s[200010];
  int mcount = 0;
  int count = 0;
  int i = 1;
  scanf("%s", s);
  while (s[i] != '\0') {
    if (s[i] == s[i - 1]) {
      mcount++;
    }
    count++;
  }
  printf("%d", count - mcount);
  return 0;
}
