#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, A[82], ans = 1000, stock = 0, rem = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) {
    int j = i;
    while (A[j + 1] > A[i]) j++;
    if (A[j] > A[i]) {
      stock = ans / A[i];
      rem = ans % A[i];
      ans = 0;
      ans = stock * A[j] + rem;
      rem = stock = 0;
      i++;
    }
  }
  cout << ans;
}
