S = gets.chomp


pattern1 = ''
pattern2 = ''

S.size.times do |i|
  if i % 2 == 0
    # 0101
    pattern1 += '0'
    # 1010
    pattern2 += '1'
  else
    # 0101
    pattern1 += '1'
    # 1010
    pattern2 += '0'
  end
end

diff1 = 0
diff2 = 0
0.upto(S.size - 1) do |i|
  if S[i] != pattern1[i]
    diff1 += 1
  end

  if S[i] != pattern2[i]
    diff2 += 1
  end
end

p [diff1, diff2].min
