#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temp;
  cin >> n;
  set<int> s;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    if (s.find(temp) == s.end()) v.push_back(temp);
    s.insert(temp);
  }
  n = v.size();
  if (v.size() == 1)
    cout << 1000;
  else {
    int amount = 1000, stocks = 0, flag = 0;
    for (int i = 0; i < n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        if (v[j] > v[i]) {
          stocks = amount / v[i];
          amount = amount % v[i] + stocks * v[j];
          i = j;
          break;
        }
      }
    }
    cout << amount;
  }
  return 0;
}
