program main
  implicit none
  integer CC, i, n, renzoku, CC2
  character(10**5) s, c
  read(*, *) s
  s = trim(s)
  n = len(s)
  !01010101010
  do i = 1,n
    if (mod(i,2) == 1) then
      if (s(i:i) == '0') then
        CC = CC + 1
      else
        CC2 = CC2 + 1
      end if
    else
      if (s(i:i) == '1') then
        CC = CC + 1
      else
        CC2 = CC2 + 1
      end if
    end if
  end do
  write(*, '(i0)') min(CC,CC2)
end program main