#include <bits/stdc++.h>
using namespace std;
const long long N = 3e3 + 10;
long long n, ans = 1, out, ar[N];
long long gcd(long long a, long long b) { return (!b) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
    ans = lcm(ans, ar[i]);
  }
  ans--;
  for (long long i = 0; i < n; i++) out += ans % ar[i];
  cout << out;
}
