#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  int pre = 0, now;
  for (int i = 0; i < n; i++) {
    cin >> now;
    if (pre != now) a.push_back(now);
    pre = now;
  }
  if (a.size() == 1) {
    cout << 1000 << endl;
    return 0;
  } else if (a.size() == 2) {
    if (a[0] >= a[1]) {
      cout << 1000 << endl;
    } else {
      cout << 1000 + (1000 / a[0]) * (a[1] - a[0]) << endl;
    }
    return 0;
  }
  vector<int> a2;
  if (a[0] < a[1]) a2.push_back(a[0]);
  for (int i = 1; i < (int)a.size() - 1; i++) {
    if (a[i] > a[i - 1] && a[i] > a[i + 1])
      a2.push_back(a[i]);
    else if (a[i] < a[i - 1] && a[i] < a[i + 1])
      a2.push_back(a[i]);
  }
  if (a2.size() % 2 == 1) a2.push_back(a[a.size() - 1]);
  int ans = 1000;
  for (int i = 0; i < (int)a2.size(); i += 2) {
    ans += (ans / a2[i]) * (a[i + 1] - a[i]);
  }
  cout << ans << endl;
  return 0;
}
