program One_dimentional_reverse
    implicit none
    character(100000):: s
    integer(4)ls, i, cnt

    read*, s
    ls = len_trim(s)
    cnt=0
    do i=1, ls-1
        if(s(i:i) /= s(i+1:i+1)) cnt=cnt+1
    end do

    print*, cnt
    
end program One_dimentional_reverse