import math
from functools import reduce

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

input()
l = list(map(int, input().split()))
m = reduce(lcm, l, 1) - 1

ans = 0
for i in range(len(l)):
	ans += m % l[i]

print(ans)