#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
const int mod = 1000000007;
const int INF = 1 << 30;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string YN(bool b) { return (b ? "YES" : "NO"); }
string yn(bool b) { return (b ? "Yes" : "No"); }
long long int n, v[3010];
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  long long int ans = 1, ans2 = 0;
  cin >> n;
  for (long long int i = (long long int)0; i < (long long int)n; ++i) {
    cin >> v[i];
    ans = ans * v[i] / gcd(ans, v[i]);
  }
  --ans;
  for (long long int i = (long long int)0; i < (long long int)n; ++i)
    ans2 += ans % v[i];
  cout << ans2 << endl;
  return 0;
}
