#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  long long begtime = clock();
  ;
  long long n;
  cin >> n;
  long long a[n];
  long long prod = 1;
  for (long long i = 0; i < n; i += 1) cin >> a[i];
  for (long long i = 0; i < n; i += 1) {
    prod *= a[i];
  }
  long long sum = 0;
  prod--;
  for (long long i = 0; i < n; i += 1) {
    sum += prod % a[i];
  }
  cout << sum << endl;
  long long endtime = clock();
  cerr << endl
       << "Time elapsed: " << (endtime - begtime) * 1000 / CLOCKS_PER_SEC
       << " ms";
  return 0;
}
