#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T = 1;
  while (T--) {
    int n;
    cin >> n;
    int a[n + 1], mx = 0;
    for (int i = 0; i <= n - 1; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    vector<int> v;
    a[n] = 0;
    for (int i = 0; i <= n - 1; i++) {
      if (a[i] == mx) {
        v.push_back(mx);
        break;
      } else if (a[i] != a[i + 1])
        v.push_back(a[i]);
    }
    if (v[0] == mx)
      cout << 1000;
    else {
      int mx = 0, cost, x;
      for (int i = 1; i <= v.size() - 1; i++) {
        cost = 1000, x = 0;
        for (int j = i; j <= v.size() - 2; j++) {
          if (v[j] > v[j - 1])
            cost += (x * v[j]), x = 0;
          else {
            x = cost / v[j], cost %= v[j];
          }
        }
        mx = max(mx, cost);
      }
      cout << cost;
    }
    cout << "\n";
  }
  return 0;
}
