#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> a(3001, 0);
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long long lcm(long long x, long long y) { return (x * y / gcd(x, y)); }
int main(void) {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> a[i];
  long long l = 1;
  for (int i = 0; i < N; ++i) {
    l = lcm(l, a[i]);
  }
  l -= 1;
  long long ans = 0;
  for (int i = 0; i < N; ++i) {
    ans += l % a[i];
  }
  cout << ans << endl;
  return 0;
}
