function Gcd(a, b) {
    if (a % b == 0) return b;
    else return Gcd(b, a%b);
}
function Lcm(a) {
    var lcm = (p, q) => p * q / Gcd(p, q);
    var ret = lcm(a[0], a[1]);
    for (var i = 2; i < a.length; i++) ret = lcm(ret, a[i]);
    return ret;
}
function f(a, m) {
    var ret = 0;
    for (var i = 0; i < a.length; i++) ret += m % a[i];
    return ret;
}
function Main(input) {
    input = input.split("\n");
    var a = input[1].split(" ").map(Number);
    console.log(f(a, Lcm(a) - 1));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));