#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.14159265358979323846;
const long long MOD = 1e+9 + 7;
const long long INF = LLONG_MAX;
const int INFi = INT_MAX;
const long long N = 2e+5 + 8;
vector<long long> adj[N];
long long vis[N];
long long dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
long long test_cases = 1;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
;
long long n, k, a[N];
void MAIN(long long tc) {
  cin >> n;
  for (long long i = (1); i <= n; i++) cin >> a[i];
  long long cash = 1000, stocks = 0, res = 1000;
  for (long long i = (1); i <= n; i++) {
    long long j = i;
    long long asc = 0, dsc = 0;
    while (a[j] == a[j + 1] && j <= n) j++;
    if (a[j] < a[j + 1]) {
      asc = 1;
      while (a[j] <= a[j + 1] && j <= n) j++;
    } else {
      dsc = 1;
      while (a[j] >= a[j + 1] && j <= n) j++;
    }
    if (j > n) break;
    if (asc) {
      stocks += cash / a[i];
      cash %= a[i];
      cash += stocks * a[j];
      stocks = 0;
    } else {
      stocks += cash / a[j];
      cash %= a[j];
      cash += stocks * a[i];
      stocks = 0;
    }
    res = max(res, cash);
    i = j;
  }
  cout << res << " ";
  cout << "\n";
  ;
  ;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  ;
  for (long long i = (1); i <= test_cases; i++) {
    MAIN(i);
  }
}
