s = gets.chomp

l = s.length

count = 0

#0101...
for i in 0..l-1 do
  if i.even? && s[i] == "1"
    count += 1
  end

  if i.odd? && s[i] == "0"
    count += 1
  end

end

min = count
count = 0

#1010...
for i in 0..l-1 do
  if i.even? && s[i] == "0"
    count += 1
  end

  if i.odd? && s[i] == "1"
    count += 1
  end

end

if count < min
  puts count
else
  puts min
end
