#include<iostream>
#include<cstring>
using namespace std;
char s[101010];
int main()
{
	cin>>s+1;
	int n=strlen(s+1);
	int ans=0;
	for(int i=2;i<=n;i++)
		if(s[i]!=s[i-1])
			ans++;
	cout<<ans<<endl;
	return 0;
}