#include <bits/stdc++.h>
long long gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
long long lcm(int a, int b) { return a / gcd(a, b) * b; }
using namespace std;
int main() {
  int N, f = 0, num, sum = 0;
  long long d = 1;
  cin >> N;
  vector<int> bin;
  while (N--) {
    cin >> num;
    bin.push_back(num);
    d = lcm(d, num);
    sum += num - 1;
  }
  d--;
  for (int i = 0; i < bin.size(); i++) {
    f += d % bin[i];
  }
  cout << sum;
}
