# xcopy
# /s
# "C:\program
# files"
# "d:"
while True:
    try:
        s = input()
        s1 = s.replace(' ', '\n')
        x = ''
        y = 0
        flag = False
        for i in s1:
            if i == '"':
                flag = not flag
            elif flag == True and i == '\n':
                x += ' '
            else:
                x += i
        y = x.count('\n') + 1
        print(y)
        print(x)
    except:
        break