#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
const int MAX = 200020;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1 << 29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
int gcd(int x, int y) { return (y == 0 ? x : gcd(y, x % y)); }
void solve(void) {
  long long N, x = 1;
  cin >> N;
  vector<long long> as(N);
  for (int i = 0; i <= N - 1; i++) {
    cin >> as[i];
    x = x * as[i] / gcd(x, as[i]);
  }
  x--;
  long long ans = 0;
  for (int i = 0; i <= N - 1; i++) {
    ans += x % as[i];
  }
  cout << ans << endl;
}
int main(void) {
  solve();
  return 0;
}
