#include <bits/stdc++.h>
using namespace std;
bool comp(string a, string b) { return a.size() < b.size(); }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  long long arr[n];
  long long prod = 1;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    prod *= arr[i];
  }
  long long suma = 0;
  prod--;
  for (int i = 0; i < n; ++i) {
    suma += (prod % arr[i]);
  }
  cout << suma << endl;
  return 0;
}
