#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> in(n);
  for (int i = 0; i < n; i++) cin >> in[i];
  bool buy = true;
  int money = 1000;
  int stock = 0;
  bool stopBuying = false;
  for (int i = 0; i < n;) {
    int j;
    for (j = i; j < n; j++) {
      if (j == n - 1) {
        if (buy) stopBuying = true;
        break;
      } else {
        if (buy && in[j] < in[j + 1]) break;
        if (!buy && in[j] > in[j + 1]) break;
      }
    }
    if (stopBuying) break;
    int targetValue = in[j];
    if (buy) {
      stock = money / targetValue;
      money %= targetValue;
    } else {
      money = money + stock * targetValue;
      stock = 0;
    }
    buy = !buy;
    i = j + 1;
  }
  cout << money << endl;
  return 0;
}
