#include <bits/stdc++.h>
using namespace std;
map<int, int> dp[100];
long long min(long long x, long long y) { return x > y ? y : x; }
long long max(long long x, long long y) { return x < y ? y : x; }
int main() {
  int n, a[80];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  dp[0][0] = 1000;
  for (int i = 0; i < n; i++) {
    for (auto itr = dp[i].begin(); itr != dp[i].end(); ++itr) {
      long long nowMoney = itr->second;
      long long nowKabu = itr->first;
      long long cnt = nowMoney / a[i];
      dp[i + 1][nowKabu + cnt] =
          max(dp[i + 1][nowKabu + cnt], nowMoney - a[i] * cnt);
      dp[i + 1][0] = max(dp[i + 1][0], nowMoney + a[i] * nowKabu);
      dp[i + 1][nowKabu] = max(dp[i + 1][nowKabu], nowMoney);
    }
  }
  long long ans = 0;
  for (auto itr = dp[n].begin(); itr != dp[n].end(); ++itr) {
    ans = max(ans, itr->second);
  }
  printf("%lld\n", ans);
  return 0;
}
