#include <bits/stdc++.h>
using namespace std;
int A[88];
set<pair<long long, long long> > S[2];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> A[i];
  long long ans = 0;
  S[0].insert({0, 1000});
  for (int i = 1; i <= n; i++) {
    int prev = (i + 1) % 2, curr = i % 2;
    for (auto s : S[prev]) {
      long long stocks = s.first, money = s.second;
      S[curr].insert({0, money + stocks * A[i]});
      S[curr].insert({stocks + money / A[i], money % A[i]});
    }
  }
  for (auto s : S[n % 2]) ans = max(ans, s.second);
  cout << ans << "\n";
  return 0;
}
