#include <bits/stdc++.h>
using namespace std;
template <typename TypeInt>
TypeInt G_C_D(TypeInt a, TypeInt b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  while (b != 0) {
    a %= b;
    if (a == 0) return b;
    b %= a;
  }
  return a;
}
template <typename TypeInt>
TypeInt G_C_D(const std::vector<TypeInt> &list) {
  if (list.size() < 2) throw "内容が1以下\n";
  TypeInt a = list[0];
  for (size_t i = 1; i < list.size(); ++i) {
    a = G_C_D(a, list[i]);
  }
  return a;
}
template <typename TypeInt>
TypeInt L_C_M(TypeInt a, TypeInt b) {
  if (a == 0 && b == 0) return 0;
  return a / G_C_D(a, b) * b;
}
template <typename TypeInt>
TypeInt L_C_M(const std::vector<TypeInt> &list) {
  if (list.size() < 2) throw "内容が1以下\n";
  TypeInt a = list[0];
  for (size_t i = 1; i < list.size(); ++i) {
    a = L_C_M(a, list[i]);
  }
  return a;
}
int main(void) {
  int n, x, m;
  cin >> n;
  vector<int> listA(n);
  for (int i = 0; i < n; i++) {
    cin >> listA.at(i);
  }
  x = L_C_M(listA) - 1;
  m = 0;
  for (int i = 0; i < n; i++) {
    m += x % listA.at(i);
  }
  cout << m << endl;
  return 0;
}
