#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 s;
  int b
  cin>>s;
  rep(i,s.size()-1){
    if(s.at(i)==s.at(i+1))
      b++;
  }
  cout<<b;
}