#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);
  vector<long long int> low(0), high(0);
  for (int i = 1; i < n + 1; i++) {
    if (a[i] <= a[i - 1] && a[i] < a[i + 1]) {
      low.push_back(a[i]);
    }
    if (a[i] >= a[i - 1] && a[i] > a[i + 1]) {
      high.push_back(a[i]);
    }
  }
  long long int ans = 1000;
  for (int i = 0; i < min(low.size(), high.size()); i++) {
    ans = (ans % low[i]) + (ans / low[i] * high[i]);
  }
  cout << ans << endl;
  return 0;
}
