#include <bits/stdc++.h>
int main(void) {
  int n, m = 1, f = 0;
  int a[3000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    m *= a[i];
  }
  m--;
  for (int i = 0; i < n; i++) {
    f += m % a[i];
  }
  printf("%d\n", f);
  return 0;
}
