#include <bits/stdc++.h>
using namespace std;
const int N = 81;
int n, a[N], f[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  f[0] = 1000;
  for (int i = 1; i <= n; ++i) {
    f[i] = f[i - 1];
    for (int j = 1; j <= i - 1; ++j)
      if (a[j] < a[i])
        f[i] = max(f[i], f[j - 1] + f[j - 1] / a[j] * (a[i] - a[j]));
  }
  cout << f[n] << endl;
  return 0;
}
