#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
vector<pair<long long int, long long int> > p;
bool pairCompare(const pair<double, long long int>& firstElof,
                 const pair<double, long long int>& secondElof) {
  return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double, long long int>& firstElof,
                       const pair<double, long long int>& secondElof) {
  return firstElof.second < secondElof.second;
}
bool x[100100];
long long int num[100100];
long long int fibl[100100] = {0};
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
long long int fib(long long int a) {
  if (fibl[a] != 0) return fibl[a];
  if (a == 0) {
    return 0;
  } else if (a == 1) {
    return 1;
  }
  return fibl[a] = fib(a - 1) + fib(a - 2);
}
long long int eratosthenes(long long int n) {
  int p = 0;
  for (long long int i = 0; i <= n; ++i) x[i] = true;
  x[0] = x[1] = false;
  for (int i = 2; i <= n; ++i) {
    if (x[i]) {
      p++;
      for (int j = 2 * i; j <= n; j += i) x[j] = false;
    }
    num[i] = p;
  }
  return p;
}
long long int gcd(long long int a, long long int b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
long long int keta(long long int N) {
  int tmp{};
  while (N > 0) {
    tmp += (N % 10);
    N /= 10;
  }
  N = tmp;
  return N;
}
int main() {
  long long int n, x = 1, ans = 0;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    x = a[i] * x / gcd(a[i], x);
  }
  x--;
  for (long long int i = 0; i < n; i++) {
    ans += x % a[i];
  }
  cout << ans << endl;
  return 0;
}
