import java.util.*;
import java.io.*;



public class Main {

     static PrintWriter p;

     public static void main(String[] args) throws Exception{
        Scanner s= new Scanner(new File("computer.in"));
         p = new PrintWriter(new File("computer.out"));
         String st = s.next();
         int ans = 0;
         int a1 = 0;
         int a2 = 0;
         for(int i = 0; i < st.length(); i ++){
            a2 = st.charAt(i) - '0';
            if (a2!=a1){
                ans++;
            }
            a1 = a2;
         }



         p.println(ans);
         p.close();


}
    static int dif(String a, String b){
        int d =0;
        for(int i = 0; i < a.length(); i++){
            if (a.charAt(i)!=b.charAt(i))d++;
        }
        return(d);
    }

}


