#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<pair<long long, long long>> currentState;
  currentState.push_back(make_pair(1000, 0));
  long long cntZeroMax = 1000;
  for (int i = 0; i < N; i++) {
    int a = A[i];
    vector<pair<long long, long long>> nextState;
    for (auto p : currentState) {
      long long money = p.first;
      long long cnt = p.second;
      if (cnt > 0) {
        long long temp = money + A[i] * cnt;
        if (temp > cntZeroMax) {
          cntZeroMax = temp;
        }
      } else {
        cntZeroMax = max(cntZeroMax, money);
        long long nextCnt = money / A[i];
        long long nextMoney = money - A[i] * nextCnt;
        nextState.push_back(make_pair(nextMoney, nextCnt));
      }
    }
    nextState.push_back(make_pair(cntZeroMax, 0));
    swap(currentState, nextState);
  }
  cout << cntZeroMax << endl;
  return 0;
}
