program main
  implicit none
  character(100000) :: s
  integer :: i, cnt
  read(*, *) s
  cnt = 0
  do i = 2, len(trim(s))
    if (s(i - 1:i - 1) /= s(i:i)) then
      cnt = cnt + 1
    end if
  end do
  write(*, "(i0)") cnt
  contains
end
