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