#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <string>
using namespace std;

int main (){
   string current_chess;
   cin >> current_chess;
   if (current_chess.length() == 0 ){
        cout << 0 << endl;
        return 0;
   }
   if (current_chess.length() == 1 ){
        cout << 0 <<endl;
        return 0;
   }
   char current_char = current_chess[0];
   int counter = 0;
   for (int i = 1; i < current_chess.length(); i ++ ){
        if (current_chess[i] != current_char) {
             counter ++;
             current_char = current_chess[i];
        } 
        else {
             continue;
        }
   }
   cout << counter << endl;
   return 0;
}