#include <bits/stdc++.h>
template <class _T>
static _T tp_abs(const _T& a) {
  return ((a < 0) ? (a * -1) : a);
}
template <class _T>
static _T tp_min(_T a, _T b) {
  return a < b ? a : b;
}
template <class _T>
static _T tp_max(_T a, _T b) {
  return a > b ? a : b;
}
template <class _T>
static void get1int(_T& a) {
  const char* fmt = " %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld";
  }
  if (scanf(fmt, &a) < 0) {
    printf("g1int Error\n");
  }
}
template <class _T>
static void get2int(_T& a, _T& b) {
  const char* fmt = " %d %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld %lld";
  }
  if (scanf(fmt, &a, &b) < 0) {
    printf("g2int Error\n");
  }
}
template <class _T>
static void get3int(_T& a, _T& b, _T& c) {
  const char* fmt = " %d %d %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld %lld %lld";
  }
  if (scanf(fmt, &a, &b, &c) < 0) {
    printf("g3int Error\n");
  }
}
template <class _T>
static _T tp_gcd(_T first, _T second) {
  _T num1 = first, num2 = second;
  _T remainder = 0, common = 0;
  if (!num1) return num2;
  if (!num2) return num1;
  while (!common) {
    remainder = num1 % num2;
    if (remainder == 0) {
      common = num2;
    } else {
      num1 = num2;
      num2 = remainder;
    }
  }
  return (common);
}
template <class _T>
static _T tp_lcm(_T first, _T second) {
  _T gcd = tp_gcd<_T>(first, second);
  return first * second / gcd;
}
static void ABC103C_ModuleSummation();
int main() {
  ABC103C_ModuleSummation();
  fflush(stdout);
  return 0;
}
static void ABC103C_ModuleSummation() {
  int N;
  get1int(N);
  auto seq = new long long[N];
  long long lcm = 1;
  for (int i = 0; i < N; i++) {
    get1int(seq[i]);
    lcm = tp_lcm<long long>(lcm, seq[i]);
  }
  long long fn = 0;
  for (int i = 0; i < N; i++) {
    fn += (lcm - 1) % seq[i];
  }
  printf("%lld\n", fn);
  delete[] seq;
}
