#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n, 0);
  int minn = INT_MAX;
  for (int i = 0; i < n; ++i) cin >> v[i], minn = min(minn, v[i]);
  int buy = 1000 / minn;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int maxx = 0;
    if (v[i] == minn) {
      for (int j = i + 1; j < n; ++j) maxx = max(maxx, v[j]);
      if (maxx != 0)
        ans = buy * maxx;
      else
        ans = 1000;
      break;
    }
  }
  cout << ans;
}
