import math

def main(N, a):
    m = getlcm(N, a) - 1
    f = 0
    for i in range(N):
        f += m % a[i]
    print(f)

def getlcm(N, a):
    l = 1
    for i in range(N):
        l = l * a[i] // math.gcd(l, a[i])
    return l
    
if __name__ == '__main__':
    N = int(input())
    a = [int(i) for i in input().split()]

    main(N, a)
