#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 5;
int main() {
  int T = 1;
  while (T--) {
    int n, low[100], x[100];
    int mm = 500;
    scanf("%d", &n);
    int a;
    for (int i = 0; i < n; i++) {
      scanf("%d", &x[i]);
      mm = min(mm, x[i]);
      low[i] = mm;
    }
    int ans = 1000;
    for (int i = 1; i < n; i++) {
      ans = max(ans, (1000 / low[i - 1]) * x[i] + (1000 % low[i - 1]));
    }
    printf("%d", ans);
  }
  return 0;
}
