program main
  implicit none
  character(100000) :: s
  character(1) :: c
  integer :: n, i, res, r
  read (*, *) s
  n = len_trim(s)
  res = 0
  do i = 1, n
    write (c, "(i1)") mod(i, 2)
    if (s(i:i) == c) res = res + 1
  end do
  r = 0
  do i = 1, n
    write (c, "(i1)") mod(i + 1, 2)
    if (s(i:i) == c) r = r + 1
  end do
  res = min(res, r)
  write (*, "(i0)") res
end program main
