#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  long long int my = 1000, kabu = 0;
  for (int i = 0; i < n; ++i) {
    mp[a[i]]--;
    bool l = false, h = false;
    ;
    for (int k = i + 1; k < n; k++) {
      if (a[i] > a[k]) {
        l = true;
        if (h)
          break;
        else {
          my += a[i] * kabu;
          kabu = 0;
          break;
        }
      }
      if (a[i] < a[k]) {
        h = true;
        if (l)
          break;
        else {
          int p = my / a[i];
          kabu += p;
          my -= a[i] * p;
          break;
        }
      }
    }
    if (i == n - 2 && a[i] < a[i + 1]) {
      int p = my / a[i];
      kabu += p;
      my -= a[i] * p;
    }
  }
  my += kabu * a[n - 1];
  cout << my << endl;
  return 0;
}
