#include <bits/stdc++.h>
using namespace std;
int main() {
  long long AA = 500;
  long long N;
  cin >> N;
  vector<vector<long long>> DP(N + 1, vector<long long>(AA + 5, -1));
  vector<long long> data(N);
  for (long long(i) = long long(0); (i) < long long(N); (i)++) {
    cin >> data[i];
  }
  DP[0][0] = 1000;
  for (long long(i) = long long(0); (i) < long long(N); (i)++) {
    for (long long(j) = long long(0); (j) < long long(AA); (j)++) {
      long long aa = DP[i][j];
      if (aa != -1) {
        for (long long(k) = long long(0); (k) < long long(aa / data[i] + 1);
             (k)++) {
          if (j + k <= AA + 1) {
            DP[i + 1][j + k] =
                ((aa - k * data[i]) > (DP[i + 1][j + k]) ? (aa - k * data[i])
                                                         : (DP[i + 1][j + k]));
          }
        }
        for (long long(k) = long long(0); (k) < long long(j + 1); (k)++) {
          if (j - k >= 0) {
            DP[i + 1][j - k] =
                ((aa + k * data[i]) > (DP[i + 1][j - k]) ? (aa + k * data[i])
                                                         : (DP[i + 1][j - k]));
          }
        }
      }
    }
  }
  cout << (DP[N][0]) << endl;
  return 0;
}
