import java.util.*;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
BigInteger gmd = new BigInteger("1");
for(int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
gmd = gmd.multiply(BigInteger.valueOf(arr[i]));
}
gmd = gmd.subtract(BigInteger.valueOf(1));
int ans = 0;
for(int i = 0; i < n; i++) {
ans += (gmd.remainder(BigInteger.valueOf(arr[i])).intValue());
}
System.out.println(ans);
}
}