5 lines
241 B
Python
5 lines
241 B
Python
nums = sorted([int(l) for l in open("input", "r").read().split("\n") if l])
|
|
nums = [0] + nums + [nums[-1]+3]
|
|
diffs = [b - a for (a, b) in zip(nums[:-1], nums[1:])]
|
|
print(len([n for n in diffs if n == 1]) * len([n for n in diffs if n == 3]))
|