#gets.to_i
#data = gets.split(" ").map{|nn|nn.to_i}
#n = data[]
#m = data[]
#a = data[]
#a = data[]
#c = data[]
#n.times do
#end

data = gets.chomp.chars

cost_first_white = 0
for i in 0..(data.size-1) do
  if i % 2 == 0
    if data[i] == "0"
    else
      cost_first_white += 1
    end
  else
    if data[i] == "1"
    else
      cost_first_white += 1
    end
  end

end
cost_first_black = 0

for i in 0..(data.size-1) do
  if i % 2 == 0
    if data[i] == "1"
      next
    else
      cost_first_black += 1
    end
  else
    if data[i] == "0"
      next
    else
      cost_first_black += 1
    end
  end
end


if cost_first_black < cost_first_white
  puts cost_first_black.to_s
else
  puts cost_first_white.to_s
end