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