#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m = 0;
  unsigned long int f = 0;
  unsigned long int x = 1;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    x *= a[i];
  }
  for (int i = 0; i < n; i++) {
    f += (x - 1) % a[i];
  }
  cout << f;
  return 0;
}
