#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1001001001;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a.at(i);
  int money = 1000;
  int kabu = 0;
  for (int i = 0; i < n; i++) {
    bool buy_flg = false;
    bool sel_flg = false;
    for (int j = i; j < n; j++) {
      if (a.at(i) == a.at(j))
        continue;
      else if (a.at(i) < a.at(j)) {
        buy_flg = true;
        break;
      } else if (a.at(i) > a.at(j))
        break;
    }
    for (int j = i; j < n; j++) {
      if (i == n - 1) {
        sel_flg = true;
      } else if (a.at(i) == a.at(j))
        continue;
      else if (a.at(i) > a.at(j) || i == n - 1) {
        sel_flg = true;
      } else if (a.at(i) < a.at(j))
        break;
    }
    if (buy_flg) {
      int t = money / a.at(i);
      kabu += t;
      money -= a.at(i) * t;
    }
    if (sel_flg) {
      money += a.at(i) * kabu;
      kabu = 0;
    }
  }
  cout << kabu << endl;
  cout << money << endl;
}
