s = gets.chomp

flag = s[0]
count_1=0
count_2=0
#puts "now s = #{s}"

h = {"0"=>"1","1"=>"0"}
(s.length-1).times do|i|
  if flag==s[i+1] then
    count_1+=1
  end
  flag=h[flag]
end

s[0] = h[s[0]]
#puts "now s = #{s}"
flag=s[0]
(s.length-1).times do|i|
  if flag==s[i+1] then
    count_2+=1
  end
  flag=h[flag]
end

puts [count_1,count_2].min