#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  auto vec_unique = [](vector<int> vec) {
    set<int> s;
    for (size_t i = 0; i < vec.size(); i++) {
      s.insert(vec[i]);
    }
    vector<int> ret;
    for (auto it = s.begin(); it != s.end(); it++) {
      ret.push_back(*it);
    }
    return ret;
  };
  vector<int> vec(n);
  for (size_t i = 0; i < n; i++) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  vector<int> vec1 = vec_unique(vec);
  unsigned long long product = 1;
  for (size_t i = 0; i < vec1.size(); i++) {
    product *= vec1[i];
  }
  cout << product << endl;
  product--;
  int ans = 0;
  for (size_t i = 0; i < vec.size(); i++) {
    ans += product % vec[i];
  }
  cout << ans << endl;
  return 0;
}
