#include <bits/stdc++.h>
using ll = long long;
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ll ans = 0LL;
  ll tmp = 1LL;
  for (int i = 0; i < n; ++i) {
    tmp *= a[i];
  }
  tmp--;
  for (int i = 0; i < n; ++i) {
    ans += tmp % a[i];
  }
  cout << ans << endl;
  return 0;
}
