#include<bits/stdc++.h>
using namespace std;
#define BOOST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mp make_pair
#define pb push_back
#define ll long long
#define test(t) ll t ; cin>>t ; while(t--)
ll mulmod(ll a, ll b, ll mod){ll res = 0;a = a % mod;while (b > 0){if (b % 2 == 1)res = (res + a) % mod;a = (a * 2) % mod;b /= 2;}return res % mod;}
ll n;
int main(){
	BOOST;
	cin >> n;
	ll arr[n];
	for(ll i = 0 ; i < n ; ++i){
		cin >> arr[i];
	}
	ll ans = arr[0];
	for(ll i = 1 ; i < n ; ++i){
		ans = (arr[i] * ans)/__gcd(ans , arr[i]);
	}
	// cout << ans << endl;
	ll final = 0 ; 
	ans--;
	for(ll i = 0 ; i < n ; ++i){
		final += (ans % arr[i]);
	}
	cout << final << endl;
	return 0;
}