#include <bits/stdc++.h>
using namespace std;
template <class It>
string join(It i1, It i2) {
  ostringstream ss;
  for (auto it = i1; it != i2; ++it) ss << ((it == i1) ? "" : ", ") << (*it);
  return ss.str();
}
int main() {
  int N;
  cin >> N;
  vector<size_t> A(N);
  for (auto &a : A) cin >> a;
  size_t m(1);
  for (auto a : A) m *= a;
  ;
  size_t s(0);
  for (auto a : A) s += (m - 1) % a;
  cout << s << endl;
}
