#include <bits/stdc++.h>
using namespace std;
string repeat(string second, int n) {
  string s1 = "";
  for (int i = 0; i < n; i++) s1 += second;
  return s1;
}
string getString(char x) {
  string second(1, x);
  return second;
}
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
vector<long long> v(10000005, 1);
void solve() {
  long long n;
  cin >> n;
  int a[n];
  int money = 1000;
  for (long long i = 0; i < n; i++) cin >> a[i];
  int mx = money;
  stack<int> st;
  int stocks = 0;
  int buy = 1;
  for (int i = 0; i < n;) {
    if (buy) {
      while (i != n - 1 && a[i] >= a[i + 1]) {
        i++;
      }
      if (i == n - 1) {
        money += stocks * a[n - 1];
        mx = max(mx, money);
        cout << mx << endl;
        return;
      }
      stocks += money / a[i];
      money %= a[i];
      buy = 0;
    } else {
      while (i != n - 1 && a[i] <= a[i + 1]) {
        i++;
      }
      if (i == n - 1) {
        money += stocks * a[n - 1];
        mx = max(mx, money);
        cout << mx << endl;
        return;
      }
      money += stocks * a[i];
      stocks = 0;
      mx = max(mx, money);
      buy = 1;
    }
  }
  money += stocks * a[n - 1];
  cout << mx << endl;
}
int main() {
  optimizeIO();
  { solve(); }
}
