#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n, a[80], sell, money, kabu, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = 1000;
  for (int i = 1; i < n; i++) {
    money = 1000, kabu = 0;
    for (int j = 0; j < i; j++) {
      if (a[j] < a[j + 1]) {
        kabu = money / a[j];
        money = money % a[j];
      } else if (a[j] > a[j + 1]) {
        money = a[j] * kabu;
        kabu = 0;
      }
    }
    ans = max(money + kabu * a[i], ans);
  }
  cout << ans << endl;
  return (0);
}
