#coding: utf-8

from fraction import gcd

iN = int(input())
iAList = list(map(int, input().split()))

iKobaisu = iAList[0]
for i in range(1, len(iAList)):
    iA = iKobaisu
    iB = iAList[i]
    iKobaisu = int((iA * iB) / gcd(iA, iB))

iKobaisu -= 1

iModSum = 0
for i in range(len(iAList)):
    iModSum += (iKobaisu % iAList[i])

print (iModSum)