program prob4
    implicit none
    integer :: n, i, ans
    character(100005) :: s
    read(*,*) s
    n = len_trim(s) 
    ans = 0
    do i = 1, n-1
        if(s(i:i) /= s(i+1:i+1)) then
            ans = ans + 1
        end if
    end do
    write(*,*) ans

    stop
contains
end program prob4