#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  string s;
  cin >>s;
  int ans = 0;
  vector<char> ans;
  char buf = c[0];
  rep(i;s.size()){
    if (i == 0) continue;
    if (buf == c[i]) continue;
    else{
      ans.push_back[c[i]];
      buf = c[i];
    }
  }
  cout << ans.size() / 2 << endl;
}

