#include <bits/stdc++.h>
using namespace std;
#define IL inline
IL int read() {
	char ch = getchar(); int u = 0, f = 1;
	while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
	while (isdigit(ch)) { u = (u << 1) + (u << 3) + ch - 48; ch = getchar(); }
	return u * f;
}
char s[100005];
int main() {
	scanf("%s", s + 1); 	
	int n = strlen(s + 1);
	int ct = 0;
	for (int i = 2; i <= n; ++i) {
		if (s[i] != s[i - 1]) ct++;
	}
	cout << ct << endl;
	return 0;
}