#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i;
  cin >> N;
  int a[N];
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
  }
  long long min_lcm = 1;
  for (int i = 0; i < (N); i++) {
    min_lcm = min_lcm * a[i];
  }
  min_lcm -= 1;
  int ans = 0;
  for (int i = 0; i < (N); i++) {
    ans += min_lcm % a[i];
  }
  cout << ans << endl;
}
