#include <bits/stdc++.h>
using namespace std;
long long inf = pow(10, 9);
int n, a[81];
int dp[81][801];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 1000;
  dp[0][1000 / a[0]] = 1000 % a[0];
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < 801; j++) {
      if (dp[i][j] < 0) continue;
      int money = j * a[i] + dp[i][j];
      int count = money / a[i + 1];
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      dp[i + 1][count] = max(dp[i + 1][count], money % a[i + 1]);
    }
  }
  int res = 0;
  for (int i = 0; i < 801; i++) {
    if (dp[n - 1][i] < 0) continue;
    int temp = dp[n - 1][i] + i * a[n - 1];
    res = max(res, temp);
  }
  cout << res << endl;
}
