#include <bits/stdc++.h>
using namespace std;
long long int INF = 500;
int main() {
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  a.insert(a.begin(), INF);
  a.push_back(0);
  long long int ans = 1000, stock = 0, last = INF;
  for (int i = 1; i <= n; i++) {
    if (a[i] <= a[i - 1] && a[i] < a[i + 1]) {
      stock = ans / a[i];
      ans %= a[i];
      last = a[i];
    }
    if (a[i] >= a[i - 1] && a[i] > a[i + 1]) {
      ans += stock * a[i];
      stock = 0;
    }
  }
  cout << ans + stock * last << endl;
  return 0;
}
