#include <bits/stdc++.h>
using namespace std;
unsigned long long int gcd(unsigned long long int a, unsigned long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
unsigned long long int findlcm(unsigned long long int arr[],
                               unsigned long long int n) {
  unsigned long long int ans = arr[0];
  for (unsigned long long int i = 1; i < n; i++)
    ans = (((arr[i] * ans)) / (gcd(arr[i], ans)));
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  unsigned long long int n;
  cin >> n;
  unsigned long long int a[n];
  for (unsigned long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  unsigned long long int an = 0;
  unsigned long long int b = findlcm(a, n) - 1;
  for (unsigned long long int i = 0; i < n; i++) {
    an += (b) % a[i];
  }
  cout << an;
}
