#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a % b, b);
  return gcd(a, b % a);
}
bool vis[2005] = {false};
int conn = 0;
vector<int> v[2005];
void dfs(int q) {
  vis[q] = 1;
  for (int i = 0; i < v[q].size(); i++)
    if (!vis[v[q][i]]) dfs(v[q][i]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int k = (a[0] * a[1]) / gcd(a[0], a[1]);
  for (long long int i = 2; i < n; i++) {
    k = (k * a[i]) / gcd(k, a[i]);
  }
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    ans += (k - 1) % a[i];
  }
  cout << ans << '\n';
}
