N = int(input())
A = list(map(int,input().split()))
def f(m):
    sum = 0
    for a in A:
        sum += m % a
    return sum
# max = 0
# for i in range(0, 1000000):
#     N = f(i)
#     if N > max:
#         max = N
# print(max) # rangeの範囲じゃ限界しかない
import numpy as np
m = np.prod(A)
print(f(m-1))