#!/usr/local/bin/python
# $Id: wc.python,v 1.2 2001/05/15 03:11:19 doug Exp $
# http://www.bagley.org/~doug/shootout/

import sys

def main():
    nl = nw = nc = 0
    rl = sys.stdin.readlines
    lines = rl(4096)
    while lines:
        for line in lines:
            nl += 1
            nc += len(line)
            nw += len(line.split())
        lines = rl(4096)

    print "%d %d %d" % (nl, nw, nc)

main()