#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int ll
using namespace std;
typedef long long ll;
signed main(){
  int n;
  cin >> n;
  
  int a[n];
  rep(i,n) cin >> a[i];
  
  int b = a[0];
  rep(i,n-1) b = b*a[i+1]/__gcd(b,a[i+1]);
  
  int m = b-1;
  
  int ans = 0;
  
  rep(i,n) ans += m%a[i];
  
  cout << ans << endl;
  
  return 0;
}
                      
                      