#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
long long n, a[100];
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
  }
  long long maxx = 1000;
  for (int i = 1; i <= n; ++i) {
    int conn = 1000 / a[i];
    for (int j = i + 1; j <= n; ++j) {
      maxx = max(maxx, 1000 - conn * a[i] + conn * a[j]);
    }
  }
  printf("%lld\n", maxx);
  return 0;
}
