#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using P = std::pair<int, int>;
int main(int argc, char *argv[]) {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
  }
  ll mult = 1;
  for (int i = 0; i < N; i++) {
    mult *= a[i];
  }
  mult -= 1;
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    ans += mult % a[i];
  }
  std::cout << ans << std::endl;
  return 0;
}
