s = gets.chomp.split('')
n = s.length

cnt1 = {'0'=> 0, '1'=> 0}
cnt2 = {'0'=> 0, '1'=> 0}
o = true
s.each_with_index do |c, i|
  if o
    cnt1[c] += 1
  else
    cnt2[c] += 1
  end
  o = !o
end

puts [n - (cnt1['0'] + cnt2['1']), n - (cnt1['1'] + cnt2['0'])].min
