#include <bits/stdc++.h>
long long f(long long m, std::vector<long long>& a) {
  auto ret = 0ll;
  for (auto el : a) {
    ret += (m % el);
  }
  return ret;
}
long long lcm(std::vector<long long>& v) {
  auto ret = v[0];
  for (auto el : v) {
    for (auto i = 1ll;; i++) {
      if ((ret * i) % el == 0) {
        ret *= i;
        break;
      }
    }
  }
  return ret;
}
int main() {
  long long n, ret = 0;
  std::cin >> n;
  std::vector<long long> a(n), s(n + 1, 0);
  for (auto i = 0ll; i < n; i++) {
    std::cin >> a[i];
  }
  auto l = lcm(a);
  ret = f(l - 1, a);
  std::cout << ret << std::endl;
  return 0;
}
