bytes = int(input())
months = int(input())
rest = 0
for i in range(months):
used = int(input())
rest = bytes-used + rest
total = bytes+rest
print(total)