# -*- coding:utf-8 -*-

from functools import reduce

def gcd(a, b):
    while b:
      a, b = b, a % b
    return a

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

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

N = input()
a_list = map(int, input().split())

m = lcm(list(a_list)) - 1
fm = 0

for i in a_list:
    fm = fm+(m%i)

print(fm)