#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long v0 = a, v1 = b, v2 = a % b;
  while (v2 != 0) {
    v0 = v1;
    v1 = v2;
    v2 = v0 % v1;
  };
  return v1;
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long get_answer0(vector<int> &x) {
  long long l = 1;
  for (int i = 0; i < x.size(); i++) {
    l = lcm(l, x[i]);
  }
  return l;
}
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  int prod = 1;
  for (int i = 0; i < n; i++) prod *= x[i];
  long long m = get_answer0(x) - 1;
  cout << m << endl;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += m % x[i];
  }
  cout << ans << endl;
  return 0;
}
