#include <bits/stdc++.h>
using namespace std;
int main(void) {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  long long int n, i;
  vector<long long int> v;
  cin >> n;
  long long int a[n], p, pr, cr = 0, nxt;
  for (i = 0; i < n; i++) cin >> a[i];
  long long int st = 0, sum = 1000, ans = 1000, c;
  if (a[1] > a[0]) {
    v.push_back(a[0]);
    cr++;
  }
  for (i = 1; i < n; i++) {
    cr = v.size();
    if (cr & 1) {
      if (a[i] >= a[i - 1])
        nxt = a[i];
      else
        v.push_back(nxt);
      if (i == n - 1) v.push_back(nxt);
    } else {
      if (a[i] <= a[i - 1])
        nxt = a[i];
      else
        v.push_back(nxt);
    }
  }
  v.push_back(a[n - 1]);
  cr = 1;
  for (auto x : v) {
    if (cr & 1) {
      c = sum / x;
      sum -= c * x;
    } else {
      sum += c * x;
      ans = max(ans, sum);
    }
    cr++;
  }
  cout << ans;
}
