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