#include <bits/stdc++.h>
long long dp[100][10100];
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]);
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 10000; j++) {
      dp[i][j] = -1;
    }
  }
  dp[0][0] = 1000;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10000; j++) {
      if (dp[i][j] == -1) {
        break;
      }
      long long nowMoney = dp[i][j];
      long long cnt = nowMoney / a[i];
      for (long long k = 0; k <= cnt; k++) {
        if (j + k >= 10000) {
          break;
        }
        dp[i + 1][j + k] =
            max(dp[i + 1][j + k], dp[i][j] - (long long)a[i] * k);
      }
      for (int k = 0; k <= j; k++) {
        dp[i + 1][j - k] =
            max(dp[i + 1][j - k], dp[i][j] + (long long)a[i] * k);
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 10000; i++) {
    ans = max(ans, dp[n][i]);
  }
  printf("%lld\n", ans);
  return 0;
}
