#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
vector<int> A;
int N;
int dfs(int i = 0, int m = 1000, int k = 0) {
  if (i == N) return m;
  return max(dfs(i + 1, m - m / A[i] * A[i], k + m / A[i]),
             dfs(i + 1, m + A[i] * k, 0));
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  A.resize(N);
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  cout << dfs() << endl;
  return 0;
}
