#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *args[]) {
  int a[10000];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long GCM = 1;
  for (int i = 0; i < n; i++) {
    GCM = GCM * a[i];
  }
  long long num;
  num = GCM - 1;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum = sum + (num % a[i]);
  }
  cout << sum << endl;
}
