s = gets.strip.split('').map(&:to_i)
n = s.length

sum_1 = 0

n.times do |i|
  if i.odd? && n[i] == 0
    sum_1 += 1
  elsif i.even? && n[i] == 1
    sum_1 += 1
  else
    next
  end
end

sum_2 = n - sum_1

if sum_1 < sum_2
  puts sum_1
else
  puts sum_2
end
