#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> av(n);
  for (auto& a : av) {
    cin >> a;
  }
  vector<pair<int, int>> c;
  c.push_back({1000, 0});
  c.push_back({1000, 0});
  for (auto& a : av) {
    int value = c[1].second * a + c[1].first;
    if (value > c[0].first) {
      c[0].first = value;
    }
    int kabu1 = c[0].first / a;
    int kabu2 = c[1].first / a + c[1].second;
    if (kabu1 < kabu2) {
      c[1].first = c[1].first % a;
      c[1].second = kabu2;
    } else {
      c[1].first = c[0].first % a;
      c[1].second = kabu1;
    }
  }
  cout << c[0].first << endl;
  return 0;
}
