#include <bits/stdc++.h>
using namespace std;
int f(int m, vector<int> &val) {
  m -= 1;
  int Ans = 0;
  for (int i = 0; i < val.size(); i++) {
    Ans += (m % val[i]);
  }
  return Ans;
}
int multpy(vector<int> &val) {
  int num = 1;
  for (int i = 0; i < val.size(); i++) {
    num *= val[i];
  }
  return num;
}
int main(void) {
  int N;
  cin >> N;
  vector<int> a;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  cout << f(multpy(a), a);
  return 0;
}
