#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int r;
  if (x == 0 || y == 0) {
    fprintf(stderr, "引数エラーです。\n");
    return 0;
  }
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
int lcm(int x, int y) {
  if (x == 0 || y == 0) {
    fprintf(stderr, "引数エラーです。\n");
    return 0;
  }
  return (x * y / gcd(x, y));
}
int main() {
  int N;
  cin >> N;
  vector<int> A;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    A.push_back(a);
  }
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  long long unsigned int A_multi = A[0];
  for (int i = 1; i < N; ++i) {
    A_multi *= A[i];
  }
  int f_m_max;
  for (int i = 0; i < N; ++i) {
    f_m_max += (A_multi - 1) % A[i];
  }
  cout << f_m_max;
  return 0;
}
