#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> A(n);
  int maxVal = 0;
  int revenue = 0;
  int result = 0;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) {
    result = 1000 / A[i];
    revenue = 1000 % A[i];
    for (int j = i + 1; j < n; j++) {
      maxVal = max(maxVal, result * A[j] + revenue);
    }
  }
  cout << maxVal << '\n';
}
