s = gets.chomp

cnt = 0
while !s.index("00").nil? || !s.index("11").nil?
  min = [s.index("00") || 0, s.index("00") || 1].min
  s = s.slice(0, min) + s.slice(min + 2, s.length)
  cnt += 1
end

puts cnt
