#include <bits/stdc++.h>
using namespace std;
long dfs(long money, vector<int> &a, int kabu, int i, int n) {
  if (i == n - 1) {
    return money + kabu * a[i];
  }
  long submoney;
  if (a[i - 1] >= a[i]) {
    money += a[i] * kabu;
    kabu = 0;
  }
  submoney = dfs(money, a, kabu, i + 1, n);
  kabu = money / a[i];
  money = money % a[i];
  submoney = max(submoney, dfs(money, a, kabu, i + 1, n));
  return submoney;
}
int main() {
  int n;
  long money = 1000, ans;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = max(dfs(money % a[0], a, money / a[0], 1, n), dfs(money, a, 0, 1, n));
  cout << ans;
  return 0;
}
