#include <bits/stdc++.h>
using namespace std;
unsigned long long int n;
vector<unsigned long long int> a;
unsigned long long int all = 1;
unsigned long long int f(unsigned long long int m) {
  unsigned long long int sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    sum += m % a[i];
  }
  return sum;
}
int main() {
  cin >> n;
  a.reserve(n);
  for (int i = 0; i < (int)(n); i++) {
    unsigned long long int an;
    cin >> an;
    a.push_back(an);
    all *= an;
  }
  cout << f(all - 1) << endl;
  return 0;
}
