#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printmatrix(vector<vector<T> > ar) {
  for (int i = 0; i < (int)ar.size(); i++) {
    for (int j = 0; j < (int)ar[0].size(); j++) {
      cout << ar[i][j];
    }
    cout << endl;
  }
}
template <typename T>
void printvector(vector<T> vec) {
  for (int i = 0; i < (int)vec.size(); i++) {
    cout << vec[i] << endl;
  }
}
template <typename T>
void unique(vector<T>& vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
template <typename T>
vector<T> cumsum(vector<T> vec) {
  vector<T> newvec((T)vec.size());
  int tmp = 0;
  for (int i = 0; i < (int)vec.size(); i++) {
    tmp += vec[i];
    newvec[i] = tmp;
  }
  return newvec;
}
template <typename T>
T digitsum(T x) {
  T y = 0;
  while (x) {
    y += x % 10;
    x /= 10;
  }
  return y;
}
template <typename T>
T gcd(T x, T y) {
  if (x == 0 || y == 0) {
    return 0;
  }
  long long tmp;
  while (y != 0) {
    tmp = x;
    x = y;
    y = tmp % y;
  }
  return x;
}
template <typename T>
T lcm(T x, T y) {
  return x * y / gcd(x, y);
}
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long m = 1;
  for (int i = 0; i < n; i++) {
    m = lcm(m, a[i]);
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += (m - 1) % a[i];
  }
  cout << ans << endl;
  return;
}
int main(int argc, char const* argv[]) {
  solve();
  return 0;
}
