#include <bits/stdc++.h>
int gcd(int m, int n) {
  int temp;
  while (m % n != 0) {
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}
int lcm(int m, int n) { return m * n / gcd(m, n); }
int lcm_n(int* nu, int n) {
  int l;
  int i;
  l = *nu;
  for (i = 0; i < n; i++) {
    l = lcm(l, nu[i]);
  }
  return l;
}
int main() {
  int n, g, f;
  int i;
  int* num;
  scanf("%d", &n);
  num = (int*)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  g = lcm_n(num, n) - 1;
  f = 0;
  for (i = 0; i < n; i++) {
    f += g % num[i];
  }
  printf("%d\n", f);
  return 0;
}
