from fractions import gcd

N = int(eval(input()))

A = list(map(int,input().split()))



def lcm(a, b):

  return a * b // gcd (a, b)



x = A[0]

for i in range(1,N):

  x = lcm(x,A[i])

x -= 1

ans = 0

for i in range(N):

  ans += x % A[i]

print(ans)



N = int(eval(input()))

A = list(map(int,input().split()))

ans = 0

for i in range(N):

  ans += A[i] - 1

print(ans)



from fractions import gcd

N = int(eval(input()))
A = list(map(int, input().split()))


def lcm(a, b):
    return a * b // gcd(a, b)


x = A[0]
for i in range(1, N):
    x = lcm(x, A[i])
x -= 1
ans = 0
for i in range(N):
    ans += x % A[i]
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans += A[i] - 1
print(ans)

-from fractions import gcd - - - -def lcm(a, b): -    return a * b // gcd(a, b) - - -x = A[0] -for i in range(1, N): -    x = lcm(x, A[i]) -x -= 1 -    ans += x % A[i] +    ans += A[i] - 1