import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	string s = readln.chomp;
	
	int ans;
	char x = 'a';
	foreach(c; s){
		if(x != 'a') if(x != c) ans += 1;
		x = c;
		}
	
	ans.writeln;
	}