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