#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long c = a % b;
  while (true) {
    if (c == 0) break;
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
template <typename T>
T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
signed main() {
  long long a, c, d = 0;
  long long b[100000];
  cin >> a;
  for (long long i = 0; i < a; i++) {
    cin >> b[i];
  }
  c = lcm(b[0], b[1]);
  for (long long i = 2; i < a; i++) {
    c = lcm(c, b[i]);
  }
  for (long long i = 0; i < a; i++) {
    d += ((c - 1) % b[i]);
  }
  cout << d << "\n";
}
