#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  int dp[100][1001];
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j <= 1000; j++) dp[i][j] = -1;
  }
  dp[0][0] = 1000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; dp[i][j] != -1; j++) {
      for (int k = 0; k <= j; k++) {
        int money = dp[i][j] + k * arr[i];
        int num = money / arr[i];
        for (int x = 0; x <= num; x++) {
          dp[i + 1][j - k + x] = max(dp[i + 1][j - k + x], money - x * arr[i]);
        }
      }
    }
  }
  cout << dp[n][0];
  return 0;
}
