#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
constexpr int INF = 100000000;
constexpr long long LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;
int N;
vector<long long> a;
void init() {}
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long lcm(vector<long long> v) {
  size_t s = v.size();
  long long ret = 1ll;
  for (long long i = 0ll; i < static_cast<long long>(s); i++) {
    if (ret % v[i] != 0) ret = lcm(ret, v[i]);
  }
  return ret;
}
long long f(long long m) {
  long long ret = 0;
  for (long long v : a) {
    ret += m % v;
  }
  return ret;
}
void solve() {
  long long m = lcm(a) - 1;
  cout << f(m) << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  for (long long i = 0ll; i < static_cast<long long>(N); i++) {
    long long v;
    cin >> v;
    a.push_back(v);
  }
  solve();
  return 0;
}
