#include <bits/stdc++.h>
int main() {
  int n, i, k, m, f;
  long long int l, to;
  scanf("%d", &n);
  int a[n];
  l = 1;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (l % a[i] != 0) l = l * a[i];
  }
  l = l - 1;
  f = 0;
  for (i = 0; i < n; i++) f = f + l % a[i];
  printf("%d", f);
}
