#include <bits/stdc++.h>
using namespace std;
long long unsigned int gcd(long long unsigned int a, long long unsigned int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long unsigned int lcm(long long unsigned int arr[], int n) {
  long long unsigned int ans = arr[0];
  for (int i = 1; i < n; i++) ans = (((arr[i] * ans)) / (gcd(arr[i], ans)));
  return ans;
}
int main() {
  long long unsigned int n;
  long long unsigned int tmp;
  long long unsigned int m = 1;
  long long unsigned int res = 0;
  long long unsigned int *vec;
  cin >> n;
  vec = new long long unsigned int[n];
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    vec[i] = tmp;
  }
  m = lcm(vec, n) - 1;
  for (long long unsigned int i = 0; i < n; i++) {
    res += m % vec[i];
  }
  cout << res << endl;
  return 0;
}
