#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int m = 1000;
  int pre = 0;
  int maxi = 1000;
  bool f = true;
  vector<int> v;
  v.push_back(a[0]);
  for (int i = 0; i < n; ++i) {
    if (v[v.size() - 1] > a[i]) {
      if (f) {
        v.pop_back();
        v.push_back(a[i]);
      } else {
        v.push_back(a[i]);
        f = true;
      }
    } else if (v[v.size() - 1] < a[i]) {
      if (f) {
        v.push_back(a[i]);
        f = false;
      } else {
        v.pop_back();
        v.push_back(a[i]);
      }
    }
  }
  for (int i = 0; i + 1 < v.size(); i += 2) {
    int k = m / v[i];
    m -= v[i] * k;
    m += v[i + 1] * k;
  }
  cout << m << endl;
}
int main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
}
