#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100];
bool kinbi[100];
bool bech[100];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) {
    for (int j = i + 1; j < n; j++) {
      if (a[j] > a[i]) {
        kinbi[i] = 1;
      }
      if (kinbi[j] && a[j] < a[i]) {
        bech[i] = 1;
      }
    }
  }
  long long now = 1000, ans = 1000, st = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, now + st * a[i]);
    if (bech[i] && st) {
      now += st * a[i];
      st = 0;
    } else {
      int ex = now / a[i];
      st += ex;
      now -= ex * a[i];
    }
    ans = max(ans, now);
  }
  cout << ans;
}
