#include <bits/stdc++.h>
using String = std::string;
using llong = long long;
using boolean = bool;
using Pii = std::pair<int, int>;
using Vi = std::vector<int>;
using Vii = std::vector<Pii>;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;
namespace {
template <class A, class B>
A power(llong x, llong n, llong mod) {
  llong ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return ans;
}
template <class A, class B>
A power(A x, B n) {
  return power(x, n, 1000000007);
}
template <class A>
A gcd(A x, A y) {
  return x % y ? gcd(y, x % y) : y;
}
template <class A, class B>
A lcm(A x, B y) {
  return (x / gcd(x, y) * y);
}
template <class A>
inline A abs(A n) {
  return (n < 0) ? -n : n;
}
template <class A, class B>
inline bool chmax(A &a, const B &b) {
  return b > a ? a = b, true : false;
}
template <class A, class B>
inline bool chmin(A &a, const B &b) {
  return b < a ? a = b, true : false;
}
boolean isMovable(int x, int y, int w, int h) {
  return (x >= 0 && y >= 0 && x < w && y < h);
}
}  // namespace
namespace Rlyeh {
llong a[3333];
signed call_of_Cthulhu(signed datum) {
  int n;
  std::cin >> n;
  for (int i = 0; i < n; i++) std::cin >> a[i];
  llong s = a[0];
  for (int i = 1; i < n; i++) s = lcm(s, a[i]);
  s--;
  llong ans;
  for (int i = 0; i < n; i++) {
    ans += s % a[i];
  }
  std::cout << ans << '\n';
  return 0;
}
}  // namespace Rlyeh
signed main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  int main_result = Rlyeh::call_of_Cthulhu(114514);
  return 0;
}
