#include <bits/stdc++.h>
using namespace std;
int n, a[90], mx = INT_MIN;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) mx = max((1000 / a[i] * a[i + 1]), mx);
  cout << mx;
}
