#include <bits/stdc++.h>
using namespace std;
void solvetask() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 1000;
  for (int i = 0; i < n - 1; i++) {
    while (i + 1 < n && a[i + 1] < a[i]) i++;
    if (i == n) break;
    int j = i + 1, mx = a[i + 1];
    for (; j < n; j++) {
      if (a[j] < mx) {
        j--;
        break;
      }
      mx = a[j];
    }
    if (j == n) j--;
    if (a[j] <= a[i]) {
      break;
    }
    ans = ans % a[i] + (ans / a[i]) * a[j];
    i = j;
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) solvetask();
}
