import sys from collections import defaultdict input = lambda: sys.stdin.readline().rstrip() # ----------------------- # n = int(input()) S = [input() for _ in range(n)] st = set(S) alp = 'abcdefghijklmnopqrstuvwxyz' for s in S: ans = 0 for i in range(len(s)): for c in alp: if s[i] == c: continue t = list(s) t[i] = c if ''.join(t) in st: ans += 1 print(ans)