s = gets.chop

def count(s, init)
  sum = 0
  c = init
  s.size.times { |i|
    if c != s[i]
      sum += 1
    end
    c = c == "0" ? "1" : "0"
  }
  return sum
end

x = count(s,"0")
y = count(s,"1")
r = x > y ? y : x
p r