#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> A(80);
int mx = 0;
void DP(int NumK, int Cash, int Day) {
  if (Day == N - 1) {
    mx = max(Cash + NumK * A[Day], mx);
    return;
  }
  if (NumK == 0 && A[Day] <= A[max(0, Day - 1)]) {
    DP(0, Cash + NumK * A[Day], Day + 1);
    DP(NumK, Cash, Day + 1);
  } else if (NumK != 0 && A[Day] > A[max(0, Day - 1)]) {
    DP(NumK + Cash / A[Day], Cash - Cash / A[Day] * A[Day], Day + 1);
    DP(NumK, Cash, Day + 1);
  } else {
    DP(NumK + Cash / A[Day], Cash - Cash / A[Day] * A[Day], Day + 1);
    DP(0, Cash + NumK * A[Day], Day + 1);
    DP(NumK, Cash, Day + 1);
  }
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  DP(0, 1000, 0);
  cout << mx << endl;
  return 0;
}
