#include <bits/stdc++.h>
using namespace std;
int a[834534];
int main() {
  int n;
  cin >> n;
  for (register int i = 1; i <= n; i++) cin >> a[i];
  int tic = 0, mon = 1000;
  for (register int i = 2; i <= n; i++) {
    if (a[i] > a[i - 1]) mon += a[i] * tic, tic = 0;
    if (a[i + 1] > a[i]) tic += (mon / a[i]), mon = mon % a[i];
  }
  cout << mon;
  return 0;
}
