#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
int main() {
  size_t n;
  cin >> n;
  auto a = vector<uint64_t>();
  for (size_t i = 0; i < n; ++i) {
    uint64_t _a;
    cin >> _a;
    a.push_back(_a);
  }
  auto r = a[0];
  for (size_t i = 1; i < a.size(); ++i) {
    r = a[i] * r / gcd(a[i], r);
  }
  auto f = [a](uint64_t x) {
    uint64_t r = 0;
    for (auto i : a) {
      r += x % i;
    }
    return r;
  };
  cout << f(r - 1) << endl;
  return 0;
}
