#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
const long long int INF = 1e8;
signed main() {
  long long int N;
  cin >> N;
  vector<long long int> a(N);
  long long int l = 1;
  for (long long int i = 0; i < (long long int)(N); i++) {
    cin >> a[i];
    l = lcm(l, a[i]);
  }
  long long int num = l - 1;
  long long int sum = 0;
  for (long long int i = 0; i < (long long int)(N); i++) sum += num % a[i];
  cout << sum;
}
