#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int r;
  if (a < b) {
    int tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long mul = 1;
  for (long long x : a) {
    mul *= x;
  }
  long long ans = 0;
  for (long long x : a) {
    ans += (mul - 1) % x;
  }
  cout << ans << endl;
  return 0;
}
