#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 5;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  long long ans = 1000, k = 1;
  for (long long i = 0; i < n; i++) cin >> v[i];
  for (long long i = 1; i < n; i++) {
    if (v[i] != v[i - 1]) v[k++] = v[i];
  }
  v.resize(k);
  for (long long i = 0; i < k; i++) {
    long long second = 1000, cnt = 0, turn = 0;
    for (long long j = i; j < k; j++) {
      if (!turn) {
        cnt += second / v[j];
        second = second - cnt * v[j];
        turn = 1;
      } else {
        second += cnt * v[j];
        cnt = 0;
        turn = 0;
      }
    }
    ans = max(ans, second);
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) solve();
}
