/**
 * Created by IntelliJ IDEA.
 * User: m09aaa
 * Date: 07.09.2009
 * Time: 14:11:09
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import java.io.*;

   public class nusya {
        public static void main ( String[] args ) throws Exception
        {
            Scanner in=new Scanner (new File("computer.in"));
            PrintWriter out=new PrintWriter (new File("computer.out"));
            String s=in.next();
            s="0"+s;
            int kol=0;
            int ch1;
            int ch2=s.charAt(0);
            for (int i=1; i<s.length(); i++)
            {   ch1=ch2;
                ch2=s.charAt(i);
                if (ch1!=ch2)
                {
                    kol++;
                }
            }
            out.println(kol);
            out.close ();
        }
   }

