import sys

from fractions import gcd

lcm = lambda x, y : x*y // gcd(x, y)

from functools import reduce

inputs = sys.stdin.readlines()



n = int(inputs[0])

A = list(map(int, inputs[1].split()))



m = reduce(lcm, A)-1

ans = 0

for a in A:

    ans += m % a

print(ans)
import sys

inputs = sys.stdin.readlines()



n = int(inputs[0])

A = list(map(int, inputs[1].split()))



print((sum(A) - len(A)))
import sys
from fractions import gcd

lcm = lambda x, y: x * y // gcd(x, y)
from functools import reduce

inputs = sys.stdin.readlines()
n = int(inputs[0])
A = list(map(int, inputs[1].split()))
m = reduce(lcm, A) - 1
ans = 0
for a in A:
    ans += m % a
print(ans)

import sys

inputs = sys.stdin.readlines()
n = int(inputs[0])
A = list(map(int, inputs[1].split()))
print((sum(A) - len(A)))

-from fractions import gcd - -lcm = lambda x, y: x * y // gcd(x, y) -from functools import reduce -m = reduce(lcm, A) - 1 -ans = 0 -for a in A: -    ans += m % a -print(ans) +print((sum(A) - len(A)))