#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  long long m = 1;
  for (int e : v) m *= e;
  --m;
  long long ans = 0;
  for (int e : v) ans += m % e;
  cout << ans << endl;
  return 0;
}
