#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  a[n + 1] = a[n];
  ull m = 1000;
  ull c = 0;
  for (int i = 0; i < (n); i++) {
    int cur = a[i];
    int pos = 0;
    for (int j = i + 1; j <= n; j++) {
      if (cur < a[j]) {
        pos = 1;
        break;
      }
      if (cur > a[j]) {
        pos = -1;
        break;
      }
    }
    ull mm = m;
    if (pos == 1 && mm >= cur) {
      c = m / cur;
      m = m - c * cur;
    } else if (pos == -1) {
      m = m + c * cur;
      c = 0;
    }
  }
  cout << m;
}
