#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
using namespace std;
typedef long long LL;
typedef long double DD;
const int inf = 1e9;
const int mo= 1e9+7;
const int N = 200010;
char s[N];


int main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	int ans=0;
	for(int i=2;i<=n;i++)
		if(s[i]!=s[i-1])
			ans++;
	printf("%d\n",ans);
	return 0;
}