#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589;
const int INF = 1000000007;
const long long LMAX = 1000000000000001;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  long long c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long m = 1;
  for (int i = 0; i < n; i++) m *= a[i];
  m--;
  long long ans = 0;
  for (int i = 0; i < n; i++) ans += m % a[i];
  cout << ans << endl;
  return 0;
}
