import sys

if len(sys.argv) == 1:
    f = sys.stdin.buffer
    doc = f.read()
else:
    with open(sys.argv[1], 'rb') as f:
        doc = f.read()

lines = len(doc.splitlines())
words = len(doc.split())
bytes = len(doc)

print(' {0} {1:>2} {2} {3}'.format(lines, words, bytes, f.name))
