io = STDIN
s=io.gets.chomp
len=s.size
x='01'*(len/2)
y='10'*(len/2)
if len.odd?
  x=x+"0"
  y=y+"1"
end
bins=s.to_i(2)
binx=x.to_i(2)
biny=y.to_i(2)
def cnt(b)
  num = 0
  mask = 1
  while(mask != 0) do
    break if 1 << 31  == mask
    num += 1 if (b & mask) != 0 #←オドロキ！
    mask <<= 1
  end
  num
end
puts [cnt(bins^binx),cnt(bins^biny)].min
