#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (x % y == 0) {
    return y;
  } else {
    return gcd(y, x % y);
  }
}
int lcm(int x, int y) { return x * y / gcd(x, y); }
int main() {
  int num;
  int cnt = 0;
  int kekka = 0;
  cin >> num;
  vector<int> vec(num);
  for (int i = 0; i < num; i++) cin >> vec.at(i);
  int tmp = vec.at(0);
  for (int i = 1; i < num; i++) {
    cnt = lcm(tmp, vec.at(i));
    tmp = cnt;
  }
  cnt--;
  for (int i = 0; i < num; i++) {
    kekka += cnt % vec.at(i);
  }
  cout << kekka;
}
