s = gets.chomp                           
                                         
a = 0                                    
b = 0                                    
s.size.times do |i|                      
  a += 1 if (i.odd? ? "0" : "1") != s[i] 
  b += 1 if (i.odd? ? "1" : "0") != s[i] 
end                                      
                                         
puts a < b ? a : b                       
