#include <bits/stdc++.h>
using namespace std;
void next(vector<int>& A) {
  A[0]++;
  for (int i = 0; i < A.size() - 1; i++) {
    if (A[i] > 2) {
      A[i + 1]++;
      A[i] = 0;
    } else {
      break;
    }
  }
}
void buy(int& money, int& stock, int price) {
  int count = money / price;
  stock += count;
  money -= price * count;
}
void sell(int& money, int& stock, int price) {
  money += stock * price;
  stock = 0;
}
int main(void) {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int money = 1000, stock = 0, max_money = -1;
  vector<int> flag(N, 0);
  for (; flag[N - 1] <= 2; next(flag)) {
    money = 1000;
    stock = 0;
    for (int i = 0; i < N; i++) {
      if (flag[i] == 0) {
        buy(money, stock, A[i]);
      } else if (flag[i] == 1) {
        sell(money, stock, A[i]);
      }
    }
    if (max_money < money) {
      max_money = money;
    }
  }
  cout << max_money << endl;
  return 0;
}
