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

lol lcm(lol a, lol b){
    return (a*(b/(__gcd(a,b))));
}
              
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lol n,ans;
    cin >> n;
    lol x[n];
    for(lol i=0; i<n; i++){
        cin >> x[i];
        if(i==0) ans=x[i];
        else ans=lcm(ans,x[i]);
    }
    ans--;
    lol yeah=0;
    for(lol i=0; i<n; i++){
        yeah+=(ans%x[i]);
    }
    cout << yeah;
    return 0;
}