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