#include <bits/stdc++.h>
using namespace std;
int N;
long long p[3005];
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  scanf("%d", &N);
  long long tt, S = 1;
  for (int i = 1; i <= N; ++i) {
    scanf("%lld", &p[i]);
    S = p[i] * S / gcd(S, p[i]);
  }
  long long ans = 0;
  for (int i = 1; i <= N; ++i) {
    ans += (S - 1) % p[i];
  }
  printf("%lld", ans);
  return 0;
}
