S = gets.chomp

sum1 = 0
sum2 = 0

S.size.times do |i|
  if i.even?
    # 0, 2, 4..
    sum1 += 1 if S[i] == '1'
    sum2 += 1 if S[i] == '0'
  else
    sum1 += 1 if S[i] == '0'
    sum2 += 1 if S[i] == '1'
  end
end

if sum1 > sum2
  puts sum2
else
  puts sum1
end