program ABC047C
    implicit none
    integer(8)::i
    integer(8)::result=0
    character(100000)::S

    read(5,*)S

    do i=1,len_trim(S)-1
        if(S(i:i)/=S(i+1:i+1))then
            result=result+1
        end if
    end do

    print'(i0)',result
    
end program ABC047C