#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> da(n, 0);
  int last_sell = 0;
  for (int i = 1; i < n - 1; i++) {
    if (a[i] >= a[i - 1] && a[i] >= a[i + 1]) {
      da[i] = 1;
    } else if (a[i] <= a[i - 1] && a[i] <= a[i + 1]) {
      da[i] = -1;
    }
  }
  if (a[0] < a[1]) da[0] = -1;
  if (a[n - 1] > a[n - 2]) {
    da[n - 1] = 1;
  }
  int now_money = 1000;
  int now_stock = 0;
  int num_buy;
  for (int i = 0; i < n; i++) {
    if (da[i] == 1) {
      now_money += now_stock * a[i];
      now_stock = 0;
    } else if (da[i] == -1) {
      num_buy = now_money / a[i];
      now_money -= num_buy * a[i];
      now_stock += num_buy;
    }
  }
  cout << now_money;
  return 0;
}
