#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int temp;
  while (b > 0) {
    temp = b;
    b = a % b;
    a = temp;
  }
  return a;
}
int main() {
  int N, a[5000], ans = 0;
  long long mula = 1;
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> a[i];
  for (int i = 1; i <= N; ++i) mula *= a[i];
  mula--;
  for (int i = 1; i <= N; ++i) {
    int tmp = mula % a[i];
    if (tmp < 0) tmp += a[i];
    ans += tmp;
  }
  cout << ans << endl;
  return 0;
}
