#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  vector<int> dp(n);
  for (int i = 0; i < (n); ++i) {
    if (i == 0) {
      dp[i] = 1000;
      continue;
    }
    int temp = dp[i - 1];
    for (int j = 0; j < (i); ++j) {
      temp = max(temp, dp[j] % v[j] + (dp[j] / v[j]) * v[i]);
    }
    dp[i] = temp;
  }
  cout << dp[n - 1] << endl;
}
