#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
template <class T>
inline T gcd(T x, T y) {
  if (y == 0) {
    return x;
  } else if (x == 0) {
    return y;
  }
  return gcd(y, x % y);
}
template <class T>
inline T lcm(T x, T y) {
  return (x * y) / gcd(x, y);
}
template <class T>
inline void print_vector(vector<T> vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << " ";
  }
  cout << endl;
}
const long long MOD = 1e9 + 7;
const long long LLINF = 1LL << 60;
const int INF = 1 << 30;
int main(void) {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  long long mod_num = lcm(a[0], a[1]);
  for (int i = 2; i < N; i++) {
    mod_num = lcm(mod_num, a[i]);
  }
  mod_num--;
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    ans += (mod_num % a[i]);
  }
  cout << ans << endl;
  return 0;
}
