#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> trades;
  vector<int> v(n);
  for (int &i : v) cin >> i;
  int k = 0;
  int mini = 250;
  int max = 50;
  for (int i : v) {
    if (k) {
      if (i < max) {
        trades.push_back(max);
        max = 50;
        mini = i;
        k = 0;
      }
      max = i;
    } else {
      if (i > mini) {
        trades.push_back(mini);
        mini = 250;
        max = i;
        k = 1;
      }
      mini = i;
    }
  }
  if (k) {
    trades.push_back(max);
  }
  int ans = 1000;
  int stocks = 0;
  for (int i = 0; i < (int)trades.size(); ++i) {
    if (i & 1) {
      ans += trades[i] * stocks;
    } else {
      stocks = ans / trades[i];
      ans %= trades[i];
    }
  }
  cout << ans << "\n";
}
