#include <bits/stdc++.h>

using namespace std;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);

    int n, a, ans = 1;

    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        ans = lcm(ans, a);
    }

    cout << ans - 1 << endl;

    return 0;
}
