#include <bits/stdc++.h>
using namespace std;
int kabuka[85];
int n;
long long loop(long long money, long long kabu, int day) {
  if (day == n - 1) {
    return (money + kabu * kabuka[day]);
  }
  long long buy_able_kabu = money / kabuka[day];
  long long sell_able_money = kabu * kabuka[day];
  if (buy_able_kabu >= 1 && sell_able_money >= 0) {
    return max(max(money, loop(money - (kabuka[day] * buy_able_kabu),
                               kabu + buy_able_kabu, day + 1)),
               loop(money + sell_able_money, 0, day + 1));
  } else if (buy_able_kabu >= 1) {
    return max(money, loop(money - (kabuka[day] * buy_able_kabu),
                           kabu + buy_able_kabu, day + 1));
  } else if (sell_able_money >= 0) {
    return max(money, loop(money + sell_able_money, 0, day + 1));
  } else {
    return loop(money, kabu, day + 1);
  }
}
int main() {
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    cin >> kabuka[i];
  }
  cout << loop(1000, 0, 0) << endl;
}
