#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
int main() {
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  vector<vector<pair<long long, long long>>> dp(
      2, vector<pair<long long, long long>>(N + 1));
  dp[1][0] = pair<long long, long long>(1000, 0);
  dp[0][0] = pair<long long, long long>(1000, 0);
  for (int i = 0; i < N; i++) {
    long long t = dp[1][i].first / a[i];
    long long dm = dp[1][i].first - t * a[i];
    dp[0][i + 1] = pair<long long, long long>(dm, t);
    dp[1][i + 1] = dp[1][i];
    for (int j = 0; j <= i; j++) {
      long long m = dp[0][j].second * a[j] + dp[0][j].first;
      dp[1][i + 1] = max(dp[1][i + 1], pair<long long, long long>(m, 0));
    }
  }
  cout << dp[1][N].first << '\n';
}
