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