#include <bits/stdc++.h>
using namespace std;
int main() {
  int money = 1000;
  int kabu = 0;
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < (int)(n); i++) cin >> vec[i];
  bool up = false;
  for (int i = 0; i < (int)(n - 1); i++) {
    bool cup;
    if (vec[i + 1] > vec[i])
      cup = true;
    else if (vec[i + 1] < vec[i])
      cup = false;
    else
      continue;
    if (up && cup)
      continue;
    else if (!up && cup) {
      while (money - vec[i] >= 0) {
        money -= vec[i];
        kabu++;
      }
    } else if (up && !cup) {
      money += kabu * vec[i];
      kabu = 0;
    } else
      continue;
    up = cup;
  }
  if (up) money += kabu * vec.back();
  cout << money << endl;
  return 0;
}
