def diff(s, t)
  n = [s.size, t.size].min
  
  c = 0
  
  n.times do |i|
    c += (s[i] == t[i]) ? 1 : 0
  end
  
  return c
end

def main(argv)
  s = gets.chomp
  n = s.size
  
  p = '01' * ((n + 1) / 2)
  q = '10' * ((n + 1) / 2)
  
  puts [diff(s, p), diff(s, q)].min.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end