#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);
  for (auto &A : a) cin >> A;
  int mx = 1000;
  for (int i = 0; i + 1 < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (a[j] > a[i]) {
        int x = floor(1000 / a[i]);
        mx = max(mx, 1000 - a[i] * x + a[j] * x);
      }
    }
  cout << mx << '\n';
  return 0;
}
