#include <bits/stdc++.h>
using namespace std;
int main() {
  int money = 1000;
  int n;
  cin >> n;
  int a[n], b[n];
  int j = 0;
  int index = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (i != n - 1) {
      if (a[i] < a[i + 1]) {
        b[j] = a[i];
        b[j + 1] = a[i + 1];
        j += 2;
        index += 2;
      }
    }
  }
  int c[index];
  int kab = 0;
  bool ch = true;
  for (int i = 0; i < index; i++) {
    c[i] = b[i];
  }
  for (int i = 0; i < index; i += 2) {
    kab = money / c[i];
    money = money % c[i];
    money = kab * c[i + 1] + money;
  }
  cout << money << endl;
}
