#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  vector<long long> v(N);
  long long p = 1;
  for (int i = 0; i < N; ++i) {
    cin >> v[i];
    ;
    p *= v[i];
  }
  long long m = p - 1;
  long long res = 0;
  for (int i = 0; i < N; ++i) res += m % v[i];
  cout << res << "\n";
  return 0;
}
