s = gets.chomp
c = 0
while s.include?('00') || s.include?('11')
  s.size.times do |i|
    case s[i, 3]
    when '000', '011', '110'
      s[i, 3] = '010'
      c += 1
    when '100', '001', '111'
      s[i, 3] = '101'
      c += 1
    end
  end
end
puts c
