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