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