#include <bits/stdc++.h>
using namespace std;
using UL = unsigned int;
using ULL = unsigned long long;
using LL = long long;
LL cash(LL money, LL max, LL min) {
  LL mod = money % min;
  LL stock = (money / min);
  return stock * max + mod;
}
int N;
vector<LL> A;
int rec(int money, int stock, int day, int ops) {
  if (day >= N) return money;
  if (ops == 1) {
    stock += money / A[day];
    money = money % A[day];
  } else if (ops == 2) {
    money += stock * A[day];
    stock = 0;
  }
  money =
      max(max(money, rec(money, stock, day + 1, 0)),
          max(rec(money, stock, day + 1, 1), rec(money, stock, day + 1, 2)));
  return money;
}
int main() {
  scanf("%d", &N);
  A = vector<LL>(N + 1, (LL)0);
  vector<LL> T = vector<LL>(N + 1, (LL)0);
  vector<int> max_ind;
  for (int i = 0; i < (N); i++) scanf("%d ", &A[i]);
  for (int i = 0; i < (N + 1); i++) {
    if (i == 0)
      T[i] = 1000;
    else {
      for (int k = 0; k < i; k++) {
        for (int j = k; j < i + 1; j++) {
          LL tmp = cash(T[k], A[j], A[k]);
          if (T[i + 1] < tmp) T[i + 1] = tmp;
        }
      }
    }
  }
  LL maxval = 0;
  for (int i = 0; i < (N + 1); i++) {
    maxval = max(T[i], maxval);
  }
  cout << maxval << endl;
  return 0;
}
