N = int(input())
s = set()
for i in range(N):
s.add(input())
print(len(s))
N = int(input())
s = set()
for i in range(N):
s.add(hash(input()))
print(len(s))
In [3]: a = array("I", range(10000))
In [4]: b = list(range(10000))
In [5]: %timeit sum(a)
206 µs ± 6.03 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
In [6]: %timeit sum(b)
69.3 µs ± 367 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [7]: %timeit a[7777]
49.5 ns ± 0.564 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
In [8]: %timeit b[7777]
33.6 ns ± 0.411 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
In [1]: b'&\t\x07\x1c\xa8\xcd\x85\xffRmfy\xe5\xd2_\xd7\xb4)\xad\xd2'[0]
Out[1]: 38
In [2]: for b in b'&\t\x07\x1c\xa8\xcd\x85\xffRmfy\xe5\xd2_\xd7\xb4)\xad\xd2':
...: print(b)
...:
38
9
7
28
168
205
133
255
82
109
102
121
229
210
95
215
180
41
173
210
In [3]: for b in b'&\t\x07\x1c\xa8\xcd\x85\xffRmfy\xe5\xd2_\xd7\xb4)\xad\xd2':
...: print(hex(b))
...:
0x26
0x9
0x7
0x1c
0xa8
0xcd
0x85
0xff
0x52
0x6d
0x66
0x79
0xe5
0xd2
0x5f
0xd7
0xb4
0x29
0xad
0xd2