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