#include <bits/stdc++.h>
using namespace std;
long long calc(long long buy, long long sell, long long val) {
  long long nr = val / buy;
  long long rest = val % buy;
  return nr * sell + rest;
}
long long n, i, j, d;
long long a[85];
long long dp[85];
long long mini[85][85];
int main(int argc, char **argv) {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (d = 0; d < n; d++) {
    for (i = 1; i + d <= n; i++) {
      if (d == 0)
        mini[i][i + d] = a[i];
      else
        mini[i][i + d] = min(mini[i + 1][i + d], a[i]);
    }
  }
  dp[0] = 1000;
  for (i = 2; i <= n; i++) {
    dp[i] = 1000;
    dp[i] = max(dp[i], calc(mini[1][i - 1], a[i], 1000));
    for (j = 2; j < i - 1; j++) {
      dp[i] = max(dp[i], calc(mini[j + 1][i - 1], a[i], dp[j]));
    }
  }
  cout << dp[n];
  return 0;
}
