#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int money = 1000;
  int a[n];
  vector<pair<int, int>> v;
  int x;
  int y = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) {
      x = a[i];
    } else {
      if (a[i - 1] > a[i]) {
        if (y != -1) {
          v.push_back(make_pair(x, y));
        }
        x = a[i];
      } else {
        y = a[i];
      }
    }
    if (i == n - 1) {
      if (y != -1 && x < y) v.push_back(make_pair(x, y));
    }
  }
  for (auto e : v) {
    int tmp = money / e.first;
    money = money - tmp * e.first + tmp * e.second;
  }
  cout << money << endl;
  return 0;
}
