#include <bits/stdc++.h>
using namespace std;
int a[202020], n, cnt = 0, k;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int lef = 1000, ans = 1000, c = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i + 1] > a[i]) {
      c += lef / a[i];
      lef %= a[i];
    } else {
      lef += c * a[i];
      c = 0;
    }
    ans = max(ans, lef + c * a[i]);
  }
  printf("%d\n", ans);
  return 0;
}
