#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
typedef boost::multiprecision::cpp_int bigint;

const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

bigint gcd( bigint x, bigint y ){
    bigint r;
    if ( x < y ) swap( x, y );
    while ( y > 0 ){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
}
bigint lcm(bigint x, bigint y){
    return (x * y / gcd(x, y));
}

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI a(n);
	rep(i,n) cin >>a[i];
	bigint bs = 1 , ans =0;
	rep(i, n) bs = lcm(bs, a[i]);
	//dbg(bs);
	bigint tg = bs-1;
	rep(i, n) ans += tg % a[i];
	cout << ans <<"\n";
	return 0;
}
