#include <bits/stdc++.h>
using namespace std;
const long long LLINF = (1LL << 60);
const long long INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const long long MOD = 1000000007;
template <typename T>
T gcd(T a, T b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
long long N;
long long A[3010];
signed main() {
  cin >> N;
  long long val = 1;
  for (long long i = 0; i < N; ++i) {
    cin >> A[i];
    val = lcm(val, A[i]);
  }
  val--;
  long long ans = 0;
  for (long long i = 0; i < N; ++i) {
    ans += val % A[i];
  }
  printf("%lld\n", ans);
  return 0;
}
