#include <bits/stdc++.h>
using namespace std;
constexpr int R = 5e5 + 69, INF = 2e9 + 6969;
int n, T[R];
vector<int> v, t;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> T[i];
  t.push_back(T[0]);
  for (int i = 1; i < n; ++i)
    if (T[i] != T[i - 1]) t.push_back(T[i]);
  v.push_back(T[0]);
  for (int i = 1; i < n - 1; ++i) {
    if (t[i] > t[i - 1] && t[i] > t[i + 1]) v.push_back(t[i]);
    if (t[i] < t[i - 1] && t[i] < t[i + 1]) v.push_back(t[i]);
  }
  v.push_back(t[n - 1]);
  int ans = 1000;
  int st = 0;
  for (int i = 0; i < v.size() - 1; ++i) {
    if (v[i] < v[i + 1]) {
      int cur = ans / v[i];
      st += cur;
      ans -= cur * v[i];
    } else if (v[i] > v[i + 1]) {
      int cur = st * v[i];
      ans += cur;
      st = 0;
    }
  }
  if (st > 0) {
    ans += st * v[v.size() - 1];
  }
  printf("%d\n", ans);
  return 0;
}
