S = readline.chomp

count_0 = 0
S.each_char.with_index do |c,idx|
  if idx % 2 == 0
    count_0 += 1 if c != '0'
  else
    count_0 += 1 if c != '1'
  end
end

count_1 = 0
S.each_char.with_index do |c,idx|
  if idx % 2 == 0
    count_1 += 1 if c != '1'
  else
    count_1 += 1 if c != '0'
  end
end

puts [count_0,count_1].min
