S = gets
n = S.size
ans = 0
white_f = 0
black_f = 0

n.times do |i|
  if i % 2 == 0
    if S[i] == "0"
      white_f += 1
    else
      black_f += 1
    end
  else
    if S[i] == "1"
      white_f += 1
    else
      black_f += 1
    end
  end
end

if white_f < black_f
  puts white_f
else
  puts black_f
end