while True:
try:
words= input()
except:
break
else:
str1= str(words)
str1=str1.replace(' ', '\n')
e=''
flag=False
for i in str1:
if i== '"':
flag = not flag
elif flag==True and i== '\n':
e+=' '
else:
e+=i
b=e.count('\n')+1
print(b)
print(e)