#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long int val = 1;
  long long int sum = 0, gcd = arr[0], lcm = arr[0];
  for (long long int i = 0; i < n; i++) {
    val *= arr[i];
  }
  lcm = val;
  lcm = lcm - 1;
  for (long long int i = 0; i < n; i++) {
    sum += (lcm % arr[i]);
  }
  cout << sum << endl;
}
