#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num;
  long long cnt = 0;
  long long kekka = 0;
  cin >> num;
  vector<long long> vec(num);
  for (long long i = 0; i < num; i++) cin >> vec.at(i);
  cnt = vec.at(0);
  for (long long i = 1; i < num; i++) {
    cnt = cnt * vec.at(i);
  }
  cnt--;
  for (long long i = 0; i < num; i++) {
    kekka += cnt % vec.at(i);
  }
  cout << kekka;
}
