#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
const int MOOD = 998244353;
using namespace std;
int dp[81][1000];
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= 80; i++) {
    for (int j = 0; j < 1000; j++) {
      dp[i][j] = -1;
    }
  }
  dp[0][0] = 1000;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 1000; j++) {
      if (dp[i - 1][j] != -1) {
        dp[i][0] = max(dp[i][0], dp[i - 1][j] + a[i] * j);
        dp[i][j + dp[i - 1][j] / a[i]] =
            max(dp[i][j + dp[i - 1][j] / a[i]], dp[i - 1][j] % a[i]);
      }
    }
  }
  cout << dp[n][0] << endl;
  return 0;
}
