PROGRAM ATCODER

implicit none
character(len=10**5) :: s
integer :: count=0,i

read(*,*) s

do i = 1, len_trim(s)-1
  if(s(i:i) /= s(i+1:i+1))then
    count = count + 1
  end if
end do

write(*,'(i0)') count

contains
!!!!!! サブルーチンは↓
!!!!!!

END PROGRAM ATCODER