#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N, 0);
  for (int i = 0; i < N; i++) cin >> A[i];
  int money = 1000, stock = 0, tmp = 0;
  vector<int> min_A(N, 0);
  min_A = A;
  sort(min_A.begin(), min_A.end());
  for (int i = 0; i < N; i++) {
    if (A[i] == min_A[tmp] && i < N - 1) {
      tmp++;
      while (money >= A[i]) {
        money -= A[i];
        stock++;
      }
    } else {
      money += stock * A[i];
      stock = 0;
    }
  }
  cout << money << endl;
}
