import strutils, sequtils
let num = readLine(stdin).parseInt
var buri = readLine(stdin).split().map(parseInt)

var unchi = 1

for geri in buri:
  unchi *= geri

unchi -= 1
var answer = 0
for kuso in buri:
  answer += unchi mod kuso

echo $(answer)
