class Q1042
  def doIt
    eoi = "END OF INPUT"
    str = gets
    str = str[0..(str.length - 2)]
    while str != eoi
      calc str
      str = gets
      str = str[0..(str.length - 2)]
    end
  end
  
  def calc str
#    puts "calc : " + str
    #array = str.split(" ")
    array = str.split(/\s/)
    len = array.length - 1
    for i in 0..len
      print array[i].length
    end
    puts
  end
end

Q1042.new.doIt