#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int maxx = 1000, tmp, cur;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (arr[j] > arr[i]) {
        tmp = 1000 / arr[i];
        cur = 1000 - arr[i] * tmp;
        maxx = max(maxx, tmp * arr[j] + cur);
      }
    }
  }
  cout << maxx;
  return 0;
}
