#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else if (a > b)
    return gcd(b, a % b);
  else
    return gcd(a, b % a);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  long long lcm_ = 1;
  for (int i = 0; i < (N); ++i) {
    cin >> a[i];
    lcm_ = lcm(lcm_, a[i]);
  }
  long long sum = 0;
  for (int i = 0; i < (N); ++i) {
    sum += (lcm_ - 1) % a[i];
  }
  cout << sum << endl;
  return 0;
}
