#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const int INF = 1000000007;
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 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); }
long long fac(long long a) { return a > 1 ? fac(a - 1) * a : 1; }
long long fan(long long x, vector<int> v) {
  long long ret = 0;
  for (int i = 0; i < (v.size()); ++i) {
    ret += x % v[i];
  }
  return ret;
}
int solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  long long rui = 1;
  for (int i = 0; i < (n); ++i) rui *= v[i];
  cout << fan(rui - 1, v) << endl;
  return 0;
}
int main() {
  solve();
  return 0;
}
