s = gets.chomp.split('')

p1 = ['0', '1'] * (s.length / 2 + 1)
p2 = ['1', '0'] * (s.length / 2 + 1)

c1 = s.length.times.count { |i| s[i] != p1[i] }
c2 = s.length.times.count { |i| s[i] != p2[i] }

puts [c1, c2].min
