#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int N;
vector<int> a;
long long calc(long long n) {
  long long res = 0;
  for (int i = 0; i < N; ++i) {
    res += n % a[i];
  }
  return res;
}
signed main() {
  cin >> N;
  a = vector<int>(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  long long l = lcm(a[0], a[1]);
  for (int i = 2; i < N; ++i) {
    l = lcm(l, a[i]);
  }
  l--;
  cout << calc(l) << endl;
  return 0;
}
