#include <bits/stdc++.h>
using namespace std;
int N;
vector<long long> a(3001, 0);
long long Gcd(long long b, long long d) {
  if (d == 0)
    return b;
  else
    return Gcd(d, b % d);
}
long long Lcm(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / Gcd(m, n)) * n);
}
int main(void) {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) scanf("%lld", &a[i]);
  long long num = 1;
  for (int i = 0; i < N; ++i) num = Lcm(num, a[i]);
  long long ans = 0;
  for (int i = 0; i < N; ++i) ans += (num - 1) % a[i];
  printf("%lld\n", ans);
  return 0;
}
