import math
import functools


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

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

def lcm_list(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

n = int(input())
a = list(map(int, input().split()))
lcm = lcm_list(*a)

ans = 0
for aa in a :
    ans += (lcm-1) % aa

print(ans)