import sys
R = T = N = 0
for l in sys.stdin.readlines():
l = l[:-1]
s = eval(l)
T += len(l)
R += len(s)
N += sum((2 if c in ['"', '\\'] else 1 for c in l), 2)
#print(len(l),l,len(s), s, nl)
print(T, R, T-R, N-T)