#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
char a[105];
int i;
int x,sum;
int main(){
	cin>>a;
	x=strlen(a);
	for(i=0;i<x-1;i++)if(a[i+1]==a[i])sum++;
	if(sum%2==0)cout<<sum<<endl;
	else cout<<sum-1<<endl;
	return 0;
}