#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool change(T& a, T b) {
  if (a != b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
long long dp[100][2000000];
long long a[100];
long long n;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  dp[1][0] = 1000;
  long long maxm = 2000000;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j < maxm; j++) dp[i][j] = -1;
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < maxm; j++) {
      if (dp[i][j] != -1) {
        chmax(dp[i + 1][j], dp[i][j]);
        chmax(dp[i + 1][0], dp[i][j] + a[i] * j);
        chmax(dp[i + 1][j + dp[i][j] / a[i]], dp[i][j] % a[i]);
      }
    }
  }
  cout << dp[n + 1][0] << endl;
}
