#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vec2 = vector<vector<ll>>;
ll inf = pow(2, 62);
int main() {
  int n;
  cin >> n;
  vec A(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> A[i];
  }
  int Max = -1;
  for (int bit = 0; bit < (1 << n - 1); bit++) {
    int mon = 1000;
    for (int i = 0; i < n - 1; i++) {
      if (bit & (1 << i)) {
        int e = mon / A[i];
        mon = mon - e * A[i] + e * A[i + 1];
      }
    }
    Max = max(Max, mon);
  }
  cout << Max << endl;
}
