#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n), b;
  for (int i = 0; i <= n - 1; i++) cin >> a[i];
  int ans = 1000, st = 0;
  for (int i = 0; i <= n - 2; i++) {
    if (a[i] != a[i + 1]) b.push_back(a[i]);
  }
  b.push_back(a[n - 1]);
  a = b;
  n = a.size();
  for (int i = 0; i <= n - 2; i++) {
    if (a[i] < a[i + 1]) {
      st += ans / a[i];
      ans %= a[i];
    } else if (a[i] > a[i + 1]) {
      ans += st * a[i];
      st = 0;
    }
  }
  ans += st * a[n - 1];
  cout << ans;
  return 0;
}
