#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
vector<int> tradeList;
int ans = 0;
void checkResult() {
  int money = 1000;
  int stock = 0;
  for (int i = 0; i < tradeList.size(); i++) {
    switch (tradeList[i]) {
      case (0):
        stock += money / a[i];
        money = money % a[i];
        break;
      case (1):
        money += stock * a[i];
        stock = 0;
        break;
      case (2):
        break;
      default:
        break;
    }
  }
  ans = max(ans, money);
}
void dfs(int trade) {
  tradeList.push_back(trade);
  if (tradeList.size() == n) {
    checkResult();
  } else {
    dfs((0));
    tradeList.pop_back();
    dfs((1));
    tradeList.pop_back();
    dfs((2));
    tradeList.pop_back();
  }
}
int main() {
  cin >> n;
  a = vector<int>(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) {
      tradeList.push_back((0));
    } else if (a[i] > a[i + 1]) {
      tradeList.push_back((1));
    } else {
      tradeList.push_back((2));
    }
  }
  tradeList.push_back((1));
  checkResult();
  cout << ans << endl;
  return 0;
}
