#include <bits/stdc++.h>
using namespace std;
template <typename T>
const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-11;
int max(int a, int b, int c) { return max(a, max(b, c)); }
int min(int a, int b, int c) { return min(a, min(b, c)); }
long long max(long long x, long long y) { return x > y ? x : y; }
long long min(long long x, long long y) { return x < y ? x : y; }
long long max(long long a, long long b, long long c) {
  return max(a, max(b, c));
}
long long min(long long a, long long b, long long c) {
  return min(a, min(b, c));
}
long long gcd(long long a, long long b) {
  long long greater = max(a, b), less = min(a, b);
  long long remainder = greater % less;
  if (remainder == 0) {
    return less;
  } else {
    return gcd(less, remainder);
  }
}
int main() {
  int n;
  cin >> n;
  long long k = 1;
  vector<long long> a(n);
  for (int i = 0; i < (int)n; i++) {
    cin >> a[i];
    k = (a[i] * k) / gcd(k, a[i]);
  }
  long long ans = 0;
  for (int i = 0; i < (int)n; i++) {
    ans += ((k - 1) % a[i]);
  }
  cout << ans << endl;
  return 0;
}
