#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;

const int maxn = 100010;

char str[maxn];

int main(){
  scanf("%s", str + 1);
  int ans = 0;
  for(int i = 1, j;str[i] !='\0';){
    for(j = i + 1;str[j] != '\0' && str[j] == str[i];++j);
    //   cout<<"get "<<i<<' '<<j - 1<<endl;
    i = j;
    // cout<<"get "<<j<<' '<<endl;
    ans++;
  }
  printf("%d\n", ans - 1);
  return 0;
}
