#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int x, int y) { return (x * y / gcd(x, y)); }
int main(void) {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); ++i) cin >> a[i];
  int lcmn = 1;
  for (int i = 0; i < (N); ++i) lcmn = lcm(lcmn, a[i]);
  int ans = 0;
  for (int i = 0; i < (N); ++i) ans += (lcmn - 1) % a[i];
  cout << ans << endl;
  return 0;
}
