#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;

int main() {
  int N;
  cin >> N;
  vector<cpp_int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  cpp_int ans = 1;
  for (int i = 0; i < N; i++) {
    ans = lcm(ans, A.at(i));
  }
  ans--;
  cpp_int ans2 = 0;
  for (int i = 0; i < N; i++) {
    ans2 += ans % A.at(i);
  }
  cout << ans2 << "\n";
}