program color
  implicit none
  character s*100000
  integer leng,i,count,flag,ans

  flag = 0
  ans = 0
  read *, s
  leng = len_trim(s)
  do i = 1, leng
    if (flag == 0) then
      if (s(i:i) == "0") ans = ans +1
      flag = 1
    else 
      if (s(i:i) == "1") ans = ans + 1
      flag = 0
    end if
  end do
  if (ans > leng/2) ans = leng - ans
  print '(i0)', ans
  stop
end program color