S = gets.chomp

a = b = 0

for x in 0...S.size
  if x % 2 == 0
    if S[x] == "0"
      a += 1
    elsif S[x] == "1"
      b += 1
    end
  else
    if S[x] == "0"
      b += 1
    elsif S[x] == "1"
      a += 1
    end
  end
end

if a < b
  puts a
else
  puts b
end