#include <bits/stdc++.h>
using namespace std;
long long stockBuySell(vector<int> price, int n) {
  if (n == 1) return 0;
  int i = 0;
  long long money = 1000;
  int stock = 0;
  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;
    int amountBuy = money / price[buy];
    money -= amountBuy * price[buy];
    stock += amountBuy;
    money += stock * price[sell];
  }
  return money;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> price(n);
  for (int i = 0; i < n; i++) cin >> price[i];
  cout << stockBuySell(price, n);
}
