#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 1000000007;
const ld pi = 3.141592653589793238;
ll test[12345678];
signed main() {
  string s, t;
  ll n, m, k, a = 1000, z = 0, cnt = INF, ma = 0;
  cin >> n;
  for (ll i = 0; i < n; i++) {
    cin >> test[i];
    if (i != 0) {
      if (test[i - 1] > test[i]) {
        if (z == 0) {
          cnt = test[i];
        } else {
          ll kabu = a / cnt;
          a %= cnt;
          a += kabu * ma;
          cnt = test[i];
          ma = 0;
          z = 0;
        }
      } else {
        ma = max(ma, test[i]);
        z = 1;
      }
    } else {
      cnt = test[i];
      ma = test[i];
    }
  }
  if (z == 1) {
    ll kabu = a / cnt;
    a %= cnt;
    a += kabu * ma;
  }
  cout << a << endl;
  return 0;
}
