#include <bits/stdc++.h>
using namespace std;
bool sort_by(pair<int, int> c, pair<int, int> d) { return c.second < d.second; }
int main() {
  int N;
  cin >> N;
  int a[N];
  unsigned long long m = 1;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (m % a[i] != 0) m *= a[i];
  }
  --m;
  int ans = 0;
  for (int i = 0; i < N; i++) ans += (m % a[i]);
  cout << ans;
}
