#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < int(n); i++) cin >> a[i];
  int money = 1000;
  int stock = 0;
  vector<int> na;
  for (int i = 0; i < int(n); i++) {
    if (i == n - 1 || a[i] != a[i + 1]) na.push_back(a[i]);
  }
  int nn = na.size();
  vector<int> peak(nn, 0);
  for (int i = 0; i < int(nn); i++) {
    if (i == 0) continue;
    if (i == nn - 1 && na[i] > na[i - 1])
      peak[i] = 1;
    else if (na[i] > na[i - 1] && na[i] > na[i + 1])
      peak[i] = 1;
  }
  int inf = 0x3f3f3f3f;
  int small = inf;
  for (int i = 0; i < int(nn); i++) {
    if (peak[i]) {
      stock = money / small;
      money = money % small;
      money = money + stock * na[i];
      stock = 0;
      small = inf;
    } else {
      if (na[i] < small) small = na[i];
    }
  }
  cout << money << endl;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
