#!/usr/bin/env python3 from sys import argv i = [x.strip().split("\n") for x in open(argv[1]).read().split("\n\n")] ok = 0 ok2 = 0 for g in i: ci = set(g[0]) cx = set(g[0]) for p in g[1:]: ci |= set(p) cx &= set(p) ok += len(ci) ok2 += len(cx) print(ok) print(ok2)