s = gets.chomp
s_i = s.to_i(2)
n = s.length
h = 1
for i in 1..(n-1)
  if i%2 == 0
    h += 2**i
  end
end
h_af = s_i ^ h
kazu = h_af.to_s(2).count("1")
if n-kazu > kazu
  puts kazu
else
  puts n-kazu
end
