import re, sys

n = c = w = 0
for line in sys.stdin:
    n += 1
    c += len(line)
    L = re.findall('\s*\S+\s+', line)
    w += len(L)

print(str(n) + ' ' + str(w) + ' ' + str(c))