#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int amount = 1000, st = 0;
  vector<int> imp(n);
  imp[n - 1] = n - 1;
  for (int i = n - 2; i > -1; i--) {
    if (v[i] < v[i + 1])
      imp[i] = imp[i + 1];
    else
      imp[i] = i;
  }
  for (int i = 0; i < n; i++) {
    if (imp[i] != i) {
      st += (amount) / v[i];
      amount %= v[i];
      amount += (st)*v[imp[i]];
      st = 0;
      i = imp[i];
    }
  }
  cout << amount << endl;
}
