import sys

input = sys.stdin.readline

n = int(eval(input())) # 入力が1つ

# map(int, input().split()) # 入力が複数

nums = [int(i) for i in input().split()]



def gcd(x, y):

    if x < y:

        x, y = y, x

    if y == 0:

        return 0

    if x % y == 0:

        return y

    return gcd(y, x % y)



def lcm(x, y):

    return x * y // gcd(x, y)



l = nums[0]

for num in nums:

    l = lcm(num, l)

l -= 1

ans = 0

for num in nums:

    ans += l % num

print(ans)

import sys

input = sys.stdin.readline

n = int(eval(input())) # 入力が1つ

# map(int, input().split()) # 入力が複数

nums = [int(i) for i in input().split()]

ans = 0

for num in nums:

    ans += (num - 1)

print(ans)
import sys

input = sys.stdin.readline
n = int(eval(input()))  # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]


def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return 0
    if x % y == 0:
        return y
    return gcd(y, x % y)


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


l = nums[0]
for num in nums:
    l = lcm(num, l)
l -= 1
ans = 0
for num in nums:
    ans += l % num
print(ans)

import sys

input = sys.stdin.readline
n = int(eval(input()))  # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()]
ans = 0
for num in nums:
    ans += num - 1
print(ans)

- - -def gcd(x, y): -    if x < y: -        x, y = y, x -    if y == 0: -        return 0 -    if x % y == 0: -        return y -    return gcd(y, x % y) - - -def lcm(x, y): -    return x * y // gcd(x, y) - - -l = nums[0] -for num in nums: -    l = lcm(num, l) -l -= 1 -    ans += l % num +    ans += num - 1