#!/usr/bin/env python3

from math import *

def lcm(a,b):
    return a*(b//gcd(a,b))

n = int(input())
A = [int(x) for x in input().split()]
m = 1
for i in A:
    m = lcm(i,m)

m -= 1
ans = 0
for i in A:
    ans += m%i

print(ans)
