import sys
import fraction

dp = None
A = []

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

def f(m):
    ans = 0
    for a in A:
        ans += m % a
    return ans

def main():
    global A

    N = int(input())
    A = [int(_) for _ in input().split()]

    lcmtemp = 1

    for a in A:
        lcmtemp = lcm(lcmtemp, a)

    print(f(lcmtemp-1))

main()
