#include <bits/stdc++.h>
#pragma GCC optimze("02")
using namespace std;
using ll = long long;
const ll maxn = 105, inf = 1e18 + 18;
ll n, a[maxn], p, m, n1, m2, p2, p3;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  m = 1000;
  while (p < n - 1) {
    m2 = a[p];
    p2 = -1;
    for (int i = p + 1; i < n; i++) {
      if (a[i] > a[p]) {
        p2 = i;
        break;
      }
    }
    if (p2 == -1) {
      p++;
      continue;
    }
    p3 = -1;
    for (int i = p + 1; i < p2; i++) {
      if (a[i] < m2) {
        m2 = a[i];
        p3 = i;
      }
    }
    if (p3 == -1) {
      n1 += m / a[p];
      m = m % a[p];
      m += n1 * a[p2];
      n1 = 0;
      p = p2;
    } else
      p = p3;
  }
  cout << m << endl;
}
