      PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      character(10**5) :: s
      integer(prec) :: len, i, ans=0
      
      read*,s
      len = len_trim( s )
      
      if( len==1 )then
        print*,0
        stop
      end if
      
      do i = 2,len
        if( s(i:i)/=s(i-1:i-1) )then
          ans = ans + 1
        end if
      end do
      
      print*,ans
      
      
      stop
      !debugg
      
      print*,trim( s )
      print*,len
      
      
      
      END PROGRAM