import sys

input=sys.stdin.readline



import fractions

def lcm(x, y):

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



n = int(eval(input()))

a = list(map(int, input().split()))



m = a[0]

for i in a:

    m = lcm(m, i)



x = 0

for i in a:

    x += (m-1)%i



print(x)
import sys

input=sys.stdin.readline



int(eval(input()))

a = list(map(int, input().split()))



x = 0

for i in a:

    x += i-1

print(x)

import sys

input = sys.stdin.readline
import fractions


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


n = int(eval(input()))
a = list(map(int, input().split()))
m = a[0]
for i in a:
    m = lcm(m, i)
x = 0
for i in a:
    x += (m - 1) % i
print(x)

import sys

input = sys.stdin.readline
int(eval(input()))
a = list(map(int, input().split()))
x = 0
for i in a:
    x += i - 1
print(x)

-import fractions - - -def lcm(x, y): -    return (x * y) // fractions.gcd(x, y) - - -n = int(eval(input())) +int(eval(input())) -m = a[0] -for i in a: -    m = lcm(m, i) -    x += (m - 1) % i +    x += i - 1