#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
int N, A[81];
lint compute(int s, int t) {
  lint c = 1000 / A[s];
  lint ret = 1000 - A[s] * c;
  int prev = A[s];
  for (int i = s + 1; i < t; ++i) {
    if (c > 0) {
      if (prev < A[i]) {
        ret += A[i] * c;
        c = 0;
        prev = A[i];
      }
    } else {
      if (prev > A[i]) {
        c = ret / A[i];
        ret -= A[i] * c;
        prev = A[i];
      }
    }
  }
  return ret;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> A[i];
  lint ans = 1000;
  for (int s = 0; s < N; ++s)
    for (int t = s + 1; t < N; ++t) {
      ans = max(ans, compute(s, t + 1));
    }
  cout << ans << endl;
}
