import math


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


def f(n, A):
    return sum([n % x for x in A])


def main():
    N = int(input())
    A = list(map(int, input().split()))
    retval = 1
    for a in A:
        retval = lcm(a, retval)
    print(f(retval - 1, A))


if __name__ == "__main__":
    main()
