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