#include <bits/stdc++.h>
long int gcd(long int x, long int y);
long int lcm(long int x, long int y);
int main() {
  int i, N;
  scanf("%d", &N);
  int a[N];
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  long int m;
  m = lcm(a[0], a[1]);
  for (i = 2; i < N; i++) {
    m = lcm(m, a[i]);
  }
  long int ans = 0;
  for (i = 0; i < N; i++) {
    ans += (m - 1) % a[i];
  }
  printf("%ld\n", ans);
  return 0;
}
long int gcd(long int x, long int y) {
  int r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long int lcm(long int x, long int y) {
  int lcm;
  lcm = x * y / gcd(x, y);
  return lcm;
}
