#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long>>;
using vvs = vector<vector<string>>;
const static string el = "\n";
long long result = 0;
vi A;
int n;
void dfs(long long money, long long kabu, int date) {
  if (date > n) {
    if (result < money) {
      result = money;
    }
  } else {
    for (int i = 0; i < 2; i++) {
      if (i == 0) {
        int buyable = money / A[date - 1];
        for (int k = 0; k <= buyable; k++) {
          long long tmp_money = money - k * A[date - 1];
          long long tmp_kabu = kabu + k;
          dfs(tmp_money, tmp_kabu, date + 1);
        }
      } else {
        int sellable = kabu;
        for (int k = 0; k <= sellable; k++) {
          long long tmp_money = money + k * A[date - 1];
          long long tmp_kabu = kabu - k;
          dfs(tmp_money, tmp_kabu, date + 1);
        }
      }
    }
  }
}
int main() {
  cin >> n;
  A = vi(n);
  for (long long i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    A[i] = tmp;
  }
  long long money = 1000;
  long long kabu = 0;
  dfs(money, kabu, 1);
  cout << result << endl;
  return 0;
}
