#include <bits/stdc++.h>
using namespace std;
long long mypow(long long x, long long y) {
  long long result = 1;
  while (y != 0) {
    if (y % 2 != 0) {
      result *= x;
      y -= 1;
    }
    x *= x;
    y /= 2;
  }
  return result;
}
int main(void) {
  int n;
  cin >> n;
  int a[n];
  vector<pair<int, int>> v;
  int x;
  int y = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) {
      x = a[i];
    } else {
      if (a[i - 1] > a[i]) {
        if (y != -1) {
          v.push_back(make_pair(x, y));
        }
        x = a[i];
      } else {
        y = a[i];
      }
    }
    if (i == n - 1) {
      if (y != -1 && x < y) v.push_back(make_pair(x, y));
    }
  }
  if (v.size() == 0) {
    cout << 1000 << endl;
    return 0;
  } else if (v.size() == 1) {
    long long tmp = 1000 / v[0].first;
    cout << 1000 - tmp * v[0].first + tmp * v[0].second << endl;
    return 0;
  }
  long long ans = 1000;
  for (uint64_t i = 0; i < mypow(2, v.size() - 1); i++) {
    bool b[v.size() - 1];
    for (int j = 0; j < v.size() - 1; j++) {
      if (((i >> j) & 1) == 1)
        b[j] = true;
      else
        b[j] = false;
    }
    long long money = 1000;
    int last_j = 0;
    for (int j = 0; j < v.size(); j++) {
      if (j == v.size() - 1) {
        long long tmp = money / v[last_j].first;
        money = money - tmp * v[last_j].first + tmp * v[j].second;
        break;
      }
      if (!b[j]) {
        long long tmp = money / v[last_j].first;
        money = money - tmp * v[last_j].first + tmp * v[j].second;
        last_j = j + 1;
      }
    }
    ans = max(ans, money);
  }
  cout << ans << endl;
  return 0;
}
