#include <iostream>
using namespace std;
int main() {
string s;
cin>>s;
int a=0;
for(int i=0; i<s.length()-1; i++){
if(s[i]==s[i+1])
a++;
}
cout<<a;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CnN0cmluZyBzOwpjaW4+PnM7CmludCBhPTA7CmZvcihpbnQgaT0wOyBpPHMubGVuZ3RoKCktMTsgaSsrKXsKCWlmKHNbaV09PXNbaSsxXSkKCWErKzsKfQpjb3V0PDxhOwoJcmV0dXJuIDA7Cn0=