#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<ll> as(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> as[i];
  }
  ll money = 1000;
  ll num = 0;
  ll mmoney = -1;
  ll mnum = -1;
  for (int bit = 1; bit < (1 << n); bit++) {
    ll tmpmoney = money;
    ll tmpnum = num;
    ll num1 = num;
    ll money1 = money;
    for (int i = 0; i < (int)(n); i++) {
      if (bit & (1 << i)) {
        int j = 0;
        while (1) {
          if (num < j) {
            break;
          }
          int k = 0;
          while (1) {
            if (as[i] * k > money1 + as[i] * j) {
              break;
            }
            if (money1 + as[i] * (j - k) >= tmpmoney) {
              tmpmoney = money1 + as[i] * (j - k);
              tmpnum = num1 + (k - j);
            }
            k++;
          }
          j++;
        }
      }
      num1 = tmpnum;
      money1 = tmpmoney;
    }
    if (mmoney < tmpmoney) {
      mmoney = tmpmoney;
    }
  }
  cout << mmoney << endl;
  return 0;
}
