#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  int n;
  std::vector<int> a;
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  long long x = 1;
  for (int i = 0; i < n; i++) {
    int a_i;
    std::cin >> a_i;
    a.push_back(a_i);
    x *= a_i;
  }
  long long sum = 0;
  for (auto& a_i : a) {
    sum += (x - 1) % a_i;
  }
  std::cout << sum << std::endl;
  return 0;
}
