program coloring_colorfully
  implicit none
  character(100000) :: s
  integer :: n, i, o0, o1, e0, e1
  read(*,*) s
  s = trim(adjustl(s))
  n = len_trim(s)
  o0 = 0
  o1 = 0
  e0 = 0
  e1 = 0
  do i = 1, n, 2
    if (s(i:i).eq."0") then
      o0 = o0 + 1
    else
      o1 = o1 + 1
    end if
  end do
  do i = 2, n, 2
    if (s(i:i).eq."0") then
      e0 = e0 + 1
    else
      e1 = e1 + 1
    end if
  end do
  write(*,'(i0)') n - max(o0+e1,o1+e0)
  stop
end program coloring_colorfully