#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n;
    cin >> n;
    long long lcm;
    cin >> lcm;
    vector<long long> a(n);
    a[0] = lcm;
    for (int i = 1; i < n; i++) {
        cin >> a[i];
       lcm = lcm * a[i] / __gcd(lcm, a[i]);
    }
    lcm--;
    long long ans = 0;
    for (auto x : a) {
        ans += lcm%x;
    }
    cout << ans;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}
