13 lines
328 B
Python
13 lines
328 B
Python
#!/usr/bin/env python3
|
|
from itertools import chain, islice
|
|
|
|
lines = (x.strip() for x in open("input.txt"))
|
|
s = 0
|
|
|
|
for line1, line2, line3 in (chain([first], islice(lines, 2)) for first in lines):
|
|
i = set(line1).intersection(line2).intersection(line3)
|
|
o = ord(i.pop())
|
|
s += o - 0x60 if o > 0x60 else o - 38
|
|
|
|
print(s)
|