#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> stockBuySell(vector<int> price, int n) {
  int i = 0;
  vector<pair<int, int>> design;
  while (i < n - 1) {
    while ((i < n - 1) && (price[i + 1] <= price[i])) i++;
    if (i == n - 1) break;
    int buy = i++;
    while ((i < n) && (price[i] >= price[i - 1])) i++;
    int sell = i - 1;
    design.push_back(make_pair(buy, sell));
  }
  return design;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<pair<int, int>> ans = stockBuySell(a, n);
  int res = 1000;
  int numstocks = 0;
  for (int i = 0; i < ans.size(); i++) {
    int buy = ans[i].first;
    int sell = ans[i].second;
    int valbuy = a[buy];
    int valsell = a[sell];
    numstocks += floor(res / valbuy);
    res -= (numstocks * valbuy);
    res += (numstocks * valsell);
    numstocks = 0;
  }
  cout << res << '\n';
}
