#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int v0 = a, v1 = b, v2 = a % b;
  while (v2 != 0) {
    v0 = v1;
    v1 = v2;
    v2 = v0 % v1;
  }
  return v1;
}
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; ++i) cin >> a[i];
  long m = a[0];
  for (int i = 0; i < N - 1; ++i) {
    m *= a[i + 1];
  }
  m--;
  long ans = 0;
  for (int i = 0; i < N; ++i) {
    ans += m % a[i];
  }
  cout << ans << endl;
}
