#include <bits/stdc++.h>
using namespace std;
const int maxN = 3e3 + 5;
long long n, a[maxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long long lcm = 1, res = 0;
  for (int i = 1; i <= n; ++i) lcm *= a[i];
  for (int i = 1; i <= n; ++i) res += (lcm - 1) % a[i];
  cout << res;
  return 0;
}
