#include <bits/stdc++.h>
using namespace std;
template <typename T = long long>
inline T IN() {
  T x;
  cin >> x;
  return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&...tail) {
  cin >> head;
  CIN(move(tail)...);
}
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
long long N;
vector<long long> A;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cin >> N;
  long long mo = 0;
  for (long long i = 0; i < (N); ++i) {
    int a;
    CIN(a);
    A.emplace_back(a);
    if (i == 0)
      mo = a;
    else
      mo = mo * a / gcd(mo, a);
  }
  long long ans = 0;
  for (long long i = 0; i < (N); ++i) {
    ans += (mo - 1) % A[i];
  }
  cout << ans << "\n";
}
