import fractions
n = int(input())
lis = list(map(int,input().split()))
now = 1
for num in lis:
    now = (now * num)//fractions.gcd(now,num)
now -= 1
ans = sum([now%lis[i] for i in range(n)])
print(ans)

8dbdd9d0982daa76e460fabeafd5f68a6572b99a
<mask token>

<mask token>
for num in lis:
    now = now * num // fractions.gcd(now, num)
now -= 1
<mask token>
print(ans)

<mask token>
n = int(input())
lis = list(map(int, input().split()))
now = 1
for num in lis:
    now = now * num // fractions.gcd(now, num)
now -= 1
ans = sum([(now % lis[i]) for i in range(n)])
print(ans)

import fractions
n = int(input())
lis = list(map(int, input().split()))
now = 1
for num in lis:
    now = now * num // fractions.gcd(now, num)
now -= 1
ans = sum([(now % lis[i]) for i in range(n)])
print(ans)

import fractions
n = int(input())
lis = list(map(int,input().split()))
now = 1
for num in lis:
    now = (now * num)//fractions.gcd(now,num)
now -= 1
ans = sum([now%lis[i] for i in range(n)])
print(ans)
