d = {} for _ in range(int(input())): f = input() d[f] = 1 + d.get(f, 0) c = 0 for f in d.keys(): if d[f] - 1: c += d[f] print(c)