S = gets.chomp.chars.map(&:to_i)
N = S.length
ans = Array.new
array_0 = [0]
(N-1).times do |i|
  if array_0[i] == 0
    array_0.push(1)
  else
    array_0.push(0)
  end
end
array_1 = [1]
(N-1).times do |i|
  if array_1[i] == 1
    array_1.push(0)
  else
    array_1.push(1)
  end
end
cnt_0 = 0
(0..N-1).each do |i|
  cnt_0 += 1 unless S[i] == array_0[i]
end
ans.push(cnt_0)
cnt_1 = 0
(0..N-1).each do |i|
  cnt_1 += 1 unless S[i] == array_1[i]
end
ans.push(cnt_1)
puts ans.min
