#include <bits/stdc++.h>
using namespace std;
int a[3001];
long long m = 1;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (m % a[i] != 0) m *= a[i];
  }
  long long f = 0;
  for (int j = 0; j < n; j++) {
    f += (m - 1) % a[j];
  }
  cout << f << endl;
  return 0;
}
