#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ 48), ch = getchar();
  x *= f;
  return;
}
template <typename T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
  return;
}
const int MAXN = 88;
int n;
int a[MAXN];
int ans = 1000, cur = 1000, cnt = 0;
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  for (int i = 2; i <= n; ++i)
    while (a[i] == a[i - 1]) {
      for (int j = i; j <= n; ++j) a[j - 1] = a[j];
      --n;
    }
  for (int i = 1; i <= n; ++i)
    if (i == 1) {
      if (a[1] < a[2]) cnt += cur / a[1], cur -= cnt * a[1];
    } else if (i == n)
      cur += a[n] * cnt, cnt = 0, ans = max(ans, cur);
    else {
      if (a[i - 1] < a[i] && a[i] > a[i + 1])
        cur += cnt * a[i], cnt = 0, ans = max(ans, cur);
      if (a[i - 1] > a[i] && a[i] < a[i + 1])
        cnt = cur / a[i], cur -= cnt * a[i];
    }
  write(ans), putchar('\n');
  return 0;
}
