#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
vector<int> a;
int main() {
  cin >> N;
  a.resize(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  ll product = 1;
  for (int i = 0; i < N; i++) product *= a[i];
  ll modu = product - 1;
  ll ans = 0;
  for (int i = 0; i < N; i++) ans += modu % a[i];
  cout << ans << endl;
}
