#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vbl = vector<bool>;
using vint = vector<int>;
using vvll = vector<vll>;
using vvbl = vector<vbl>;
using vdbl = vector<double>;
using vstr = vector<string>;
using vvint = vector<vint>;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
inline void ignore_ret(int x) { x++; }
template <class T>
inline int sgn(const T& x) {
  return (x > 0) - (x < 0);
}
template <class T>
inline int digit(T x) {
  int r = 1;
  while ((x /= 10) >= 1) r++;
  return r;
}
template <class T>
inline double deg_to_rad(const T& a) {
  return a / 180.0 * M_PI;
}
template <class T>
inline double rad_to_deg(const T& a) {
  return a / M_PI * 180.0;
}
template <class T>
inline ll factorial(const T& n) {
  if (n == 0) return 1;
  ll r = 1;
  for (int i = (2), i_len = (n); i <= i_len; i++) r *= i;
  return r;
}
template <class T>
inline map<T, T> factorize(T n) {
  map<T, T> r;
  for (T i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      r[i]++;
      n /= i;
    }
  }
  if (n != 1) r[n] = 1;
  return r;
}
template <class T>
inline vector<T> divisor(const T& n) {
  vector<T> r;
  for (T i = 1; i * i <= n; i++) {
    if (!(n % i)) {
      r.emplace_back(i);
      if (i * i != n) r.emplace_back(n / i);
    }
  }
  sort((r).begin(), (r).end());
  return r;
}
template <class T>
inline bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline T nPr(const T& n, const T& k) {
  if (n < k || n < 0 || k < 0) return 0;
  T r = 1;
  for (int i = (n - k + 1), i_len = (n); i <= i_len; i++) r *= i;
  return r;
}
template <class T>
inline T nCr(const T& n, const T& k) {
  if (n < k || n < 0 || k < 0) return 0;
  T r = 1;
  k = min(k, n - k);
  for (int i = (n - k + 1), i_len = (n); i <= i_len; i++) r *= i;
  return r / factorial(k);
}
template <class T>
inline void print(const vector<T>& v) {
  cout << "[ ";
  for (auto& x : v) cout << x << ' ';
  cout << "]\n";
}
template <class T>
inline void print(const vector<vector<T>>& v) {
  for (auto& x : v) print<T>(x);
}
template <class T>
inline void print_d(const vector<T>& v, string d) {
  for (int i = 0, i_len = ((int)(v).size() - 1); i < i_len; i++)
    cout << v[i] << d;
  cout << (v).at((int)(v).size() - 1) << '\n';
}
template <class T>
inline void print_d(const vector<vector<T>>& v, string d) {
  for (auto& x : v) print_d(x, d);
}
template <class T>
inline bool in(const T& k, const vector<T>& v) {
  return find((v).begin(), (v).end(), k) != v.end();
}
inline bool in(const int& k, const vector<ll>& v) {
  return find((v).begin(), (v).end(), k) != v.end();
}
inline bool in(const ll& k, const vector<int>& v) {
  return find((v).begin(), (v).end(), k) != v.end();
}
inline bool in(const char& k, const string& v) {
  return find((v).begin(), (v).end(), k) != v.end();
}
inline bool in(const char* k, const vector<string>& v) {
  return find((v).begin(), (v).end(), k) != v.end();
}
template <class T>
inline T min(const vector<T>& v) {
  return *min_element((v).begin(), (v).end());
}
template <class T>
inline T max(const vector<T>& v) {
  return *max_element((v).begin(), (v).end());
}
template <class T>
inline ll sum(const T& v) {
  return reduce((v).begin(), (v).end(), 0LL);
}
template <class T>
inline T gcd(const vector<T>& v) {
  T r = v[0];
  for (int i = (1), i_len = ((int)(v).size() - 1); i <= i_len; i++)
    r = gcd(r, v[i]);
  return r;
}
template <class T>
inline T lcm(const vector<T>& v) {
  T r = v[0];
  for (int i = (1), i_len = ((int)(v).size() - 1); i <= i_len; i++)
    r = lcm(r, v[i]);
  return r;
}
template <class T>
inline double abs(const vector<T>& v) {
  return sqrt(
      reduce((v).begin(), (v).end(), 0.0, [](T s, T v) { return s += v * v; }));
}
template <class T>
inline T vector_add(const T& u, const T& v) {
  T r(u.size());
  for (int i = 0, i_len = (u.size()); i < i_len; i++) r[i] = u[i] + v[i];
  return r;
}
template <class T>
inline T vector_subtract(const T& u, const T& v) {
  T r(u.size());
  for (int i = 0, i_len = (u.size()); i < i_len; i++) r[i] = u[i] - v[i];
  return r;
}
template <class T>
inline T vector_multiply(const T& u, const T& v) {
  T r(u.size());
  for (int i = 0, i_len = (u.size()); i < i_len; i++) r[i] = u[i] * v[i];
  return r;
}
template <class T>
inline T dot_product(const vector<T>& u, const vector<T>& v) {
  T r = 0;
  for (int i = 0, i_len = (u.size()); i < i_len; i++) r += u[i] * v[i];
  return r;
}
template <class T>
inline T cross_product(const T& u, const T& v) {
  T r(3);
  for (int i = 0, i_len = (3); i < i_len; i++)
    r[i] = u[(i + 1) % 3] * v[(i + 2) % 3] - u[(i + 2) % 3] * v[(i + 1) % 3];
  return r;
}
template <class T>
inline void print(const set<T>& v) {
  cout << "[ ";
  for (T& x : v) cout << x << ' ';
  cout << "]\n";
}
template <class T>
inline T min(const set<T>& v) {
  return *min_element((v).begin(), (v).end());
}
template <class T>
inline T max(const set<T>& v) {
  return *max_element((v).begin(), (v).end());
}
template <class T>
inline T gcd(const set<T>& v) {
  T r = 0;
  for (T x : v) r = (r == 0) ? x : gcd(r, x);
  return r;
}
template <class T>
inline T lcm(const set<T>& v) {
  T r = 0;
  for (T x : v) r = (r == 0) ? x : lcm(r, x);
  return r;
}
template <class T>
inline void print(const unordered_set<T>& v) {
  cout << "[ ";
  for (T& x : v) cout << x << ' ';
  cout << "]\n";
}
template <class T>
inline T min(const unordered_set<T>& v) {
  return *min_element((v).begin(), (v).end());
}
template <class T>
inline T max(const unordered_set<T>& v) {
  return *max_element((v).begin(), (v).end());
}
template <class T>
inline T gcd(const unordered_set<T>& v) {
  T r = 0;
  for (T x : v) r = (r == 0) ? x : gcd(r, x);
  return r;
}
template <class T>
inline T lcm(const unordered_set<T>& v) {
  T r = 0;
  for (T x : v) r = (r == 0) ? x : lcm(r, x);
  return r;
}
template <class S, class T>
inline void print(const map<S, T>& m) {
  cout << "[ ";
  for (auto& x : m) cout << "{ " << x.first << ", " << x.second << " } ";
  cout << "]\n";
}
template <class S, class T>
inline void print(const unordered_map<S, T>& m) {
  cout << "[ ";
  for (auto& x : m) cout << "{ " << x.first << ", " << x.second << " } ";
  cout << "]\n";
}
void solve(ll N, vector<ll> a) {
  ll ans = 0;
  for (int i = 0, i_len = (N); i < i_len; i++) {
    ll tmp = 1;
    for (int j = 0, j_len = (N); j < j_len; j++) {
      tmp *= a[j];
    }
    ans += (tmp - 1) % a[i];
  }
  cout << (ans) << '\n';
}
int main() {
  ll N;
  ignore_ret(scanf("%lld", &N));
  vector<ll> a(N);
  for (int i = 0; i < N; i++) {
    ignore_ret(scanf("%lld", &a[i]));
  }
  solve(N, move(a));
  return 0;
}
