#include<iostream>
using namespace std;

int main(){
	string n,r;
	int z;
	z = 0;
	cin >> n;
	int c[n.length()];
	for (int i = 1; i < n.length()-1; i++){
		if (n[i] == n[i+1] and n[i] != n[i-1]){
			z = z+1;
		}
	}
	cout << z;
}