#include <bits/stdc++.h>
using namespace std;
const int NMAX = 82;
const int MOD = 1e9 + 7;
int a[NMAX];
long long ans;
int n;
void dfs(long long last_money, int index, int stock_num) {
  ans = max(last_money, ans);
  for (register int i = index + 1; i <= n; i++) {
    dfs(last_money + stock_num * a[i], i, 0);
    dfs(last_money - last_money / a[i] * a[i], i,
        stock_num + last_money / a[i]);
  }
}
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  a[0] = 0;
  for (register int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ans = 1000;
  for (register int i = 1; i < n; i++)
    if (a[i + 1] > a[i]) dfs(1000 - 1000 / a[i] * a[i], i, 1000 / a[i]);
  printf("%lld\n", ans);
  return 0;
}
