#include <bits/stdc++.h>
using namespace std;
using P = pair<long long int, long long int>;
int main() {
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<P>> memo(n, vector<P>(2));
  memo[0][0] = make_pair(1000 / a[0], 1000 % a[0]);
  memo[0][1] = make_pair(0, 1000);
  for (int i = 1; i < n; i++) {
    int maxkabu = -1;
    int zankin = 0;
    for (int j = i - 1; j >= 0; j--) {
      if (memo[j][0].first + memo[j][0].second / a[i] > maxkabu) {
        maxkabu = memo[j][0].first + memo[j][0].second / a[i];
        zankin = memo[j][0].second % a[i];
      }
      if (memo[j][1].first + memo[j][1].second / a[i] > maxkabu) {
        maxkabu = memo[j][1].first + memo[j][1].second / a[i];
        zankin = memo[j][1].second % a[i];
      }
    }
    memo[i][0] = make_pair(maxkabu, zankin);
    int zankin2 = 0;
    for (int j = i - 1; j >= 0; j--) {
      if (memo[j][0].first * a[i] + memo[j][0].second > zankin2) {
        zankin2 = memo[j][0].first * a[i] + memo[j][0].second;
      }
      if (memo[j][1].first * a[i] + memo[j][1].second > zankin2) {
        zankin2 = memo[j][1].first * a[i] + memo[j][1].second;
      }
    }
    memo[i][1] = make_pair(0, zankin2);
  }
  long long int ans = 1000;
  for (int i = 0; i < n; i++) {
    if (ans < memo[i][0].second) ans = memo[i][0].second;
    if (ans < memo[i][1].second) ans = memo[i][1].second;
  }
  cout << ans << endl;
  return 0;
}
