#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  string a;
  int b=a.size();
  cin>>a;
  rep(i,a.size()-1){
    if(a.at(i)==a.at(i+1)){
      replace(i,2,"");
      i--;
      }
    }
  cout<<b-a.size();
}