n, m, t = map(int,
x = list(map(int,
def build(name):
if name in built:
pass
elif b[a.index(name)] == ["0"]:
built.append(name)
else:
for i in b[a.index(: ]:
if i not in built:
build(i)
built.append(name)
a = []
b = []
built = []
for i in range(0, n):
a.append(
b.append(
for i in range(0, b.:
built.append(a[b.
a.pop(b.
b.pop(b.
[build(str(o)) for o in x]
print(len(built))
11101 = 24*1 + 23*1 + 22*1 + 21*0 + 20*1 = 16 + 8 + 4 + 0 + 1 = 29
101010 = 25*1 + 24*0 + 23*1 + 22*0 + 21*1 + 20*0 = 32 + 0 + 8 + 0 + 2 + 0 = 42
100011 = 25*1 + 24*0 + 23*0 + 22*0 + 21*1 + 20*1 = 32 + 0 + 0 + 0 + 2 + 1 = 35
10110111011 = 210*1 + 29*0 + 28*1 + 27*1 + 26*0 + 25*1 + 24*1 + 23*1 + 22*0 + 21*1 + 20*1 = 1024 + 0 + 256 + 128 + 0 + 32 + 16 + 8 + 0 + 2 + 1 = 1467
10,111,10001,1000100,100111011,1011111101,11111111111