#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int n;
int m;
vector<int> vt;
int main() {
  std ::ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vt.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> vt[i];
  }
  int ans = 1000;
  for (int pos = 0; pos < n; ++pos) {
    int result = 0, kini = 0, bechi = 0, stock = 0;
    for (int i = pos; i < n; ++i) {
      if (i == pos) {
        stock = (int)(1000 / vt[i]);
        kini = vt[i];
        result = 1000 - stock * vt[i];
      }
      if (vt[i] > kini) {
        result += vt[i] * stock;
        ans = max(ans, result);
        stock = 0;
        kini = vt[i];
        bechi = vt[i];
      }
      if (vt[i] < bechi) {
        int added = (result / vt[i]);
        result -= added * vt[i];
        stock += added;
        kini = vt[i];
        kini = vt[i];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
