#!/usr/bin/ruby
# encoding: utf-8

S = gets.chomp
n = S.size

bin0 = Array.new(n) # 0 start 
bin1 = Array.new(n) # 1 start

# 0101...と1010... を作る。
(0..n-1).each do |i|
  if i%2 == 0 then 
    bin0[i] = 0
    bin1[i] = 1
  else
    bin0[i] = 1
    bin1[i] = 0
  end
end

ans0 = 0
ans1 = 0

(0..n-1).each do |i|
  if S[i].to_i != bin0[i] then # to_i を入れること！！！
    ans0 += 1
  end
  if S[i].to_i != bin1[i] then
    ans1 += 1
  end 
end 

puts [ans0,ans1].min

