#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long long f, start;
  vector<int> a;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    a.push_back(num);
  }
  sort(a.begin(), a.end());
  start = a.at(0);
  for (int i = 1; i < N; i++) {
    start *= a.at(i);
  }
  f = 0;
  for (int i = 0; i < N; i++) {
    f = f + ((start - 1) % a[i]);
  }
  cout << f << endl;
  return 0;
}
