s = gets.chomp

x = (0...s.size).map { |i| i.even? ? '0' : '1' }.join('')
y = (0...s.size).map { |i| i.even? ? '1' : '0' }.join('')

def diff(as, bs)
  as.split('').zip(bs.split('')).reject { |a, b| a == b }.count
end

puts [diff(s, x), diff(s, y)].min
