#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
int lcm(int x, int y) { return (x * y / gcd(x, y)); }
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int x = 1;
  for (int i = 0; i < N; i++) {
    x = lcm(x, vec.at(i));
  }
  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum += ((x - 1) % vec.at(i));
  }
  cout << sum << endl;
}
