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