#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int money = 1000;
  int kabu = 0;
  int a[n + 1];
  int moneyy[81];
  for (int j = 0; j <= 80; j++) moneyy[j] = 1000;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[0] = 1000;
  int b[81];
  for (int i = 0; i < 81; i++) b[i] = 0;
  for (int i = 2; i < 81; i++) {
    if (a[i - 1] <= a[i] && a[n] > a[n + 1])
      b[i] = 1;
    else if (a[i - 1] >= a[n] && a[i] < a[i + 1])
      b[i] = -1;
  }
  for (int i = 1; i <= 80; i++) {
    if (b[i] == 1) {
      money += kabu * a[i];
      kabu = 0;
      moneyy[i] = money;
    }
    if (b[i] == -1) {
      int kabu = money / a[i];
      money = money - kabu * a[i];
    }
    if (i == 80) {
      if (kabu > 0) {
        money += kabu * a[80];
        moneyy[80] = money;
      }
    }
  }
  int max = 1000;
  for (int i = 1; i <= 80; i++) {
    int v = moneyy[i];
    if (v >= max) max = v;
  }
  cout << max << endl;
}
