import math
from functools import reduce

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

def lcm_list(nums):
  return reduce(lcm, nums)

n = int(input())
a = list(map(int, input().split()))
m = lcm_list(a) - 1
ans = 0
for i in range(n):
  ans += m % a[i]

print(ans)