#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long m = 1, ans = 0;
  for (int i = 0; i < n; i++) m *= a[i];
  cout << m << endl;
  for (int i = 0; i < n; i++) ans += (m - 1) % a[i];
  cout << ans << endl;
  return 0;
}
