#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) {
  while (true) {
    if (a == 0) {
      return b;
    }
    b %= a;
    if (b == 0) {
      return a;
    }
    a %= b;
  }
}
int64_t lcm(int64_t a, int64_t b) {
  int64_t temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
int calc(const std::vector<int> as) {
  int64_t as_lcm = 1;
  for (const auto& a : as) {
    as_lcm = lcm(as_lcm, a);
  }
  int ret = 0;
  for (const auto& a : as) {
    ret += (as_lcm - 1) % a;
  }
  return ret;
}
int main() {
  int n;
  std::cin >> n;
  std::vector<int> as(n);
  for (auto& a : as) {
    std::cin >> a;
  }
  std::cout << calc(as) << std::endl;
  return 0;
}
