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