import math
from fractions import Fraction
from functools import reduce

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


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


m =  lcm_list(A) -1

B = 0

for j in range(len(A)):
    B += m%A[j]

print(B)