#include<bits/stdc++.h>

template<typename First, typename Second, typename Third>
struct triple {
   First first;
   Second second;
   Third third;
};
using namespace std;

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

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