#include <bits/stdc++.h>
using namespace std;
int n, a[85], memo[85][40005];
int dp(int day, int money) {
  if (day == n) return money;
  int tmp = money;
  for (int i = day; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      int profit = (money / a[i]) * (a[j] - a[i]);
      if (profit < 0) continue;
      tmp = max(tmp, dp(j + 1, money + profit));
    }
  }
  return memo[day][money] = tmp;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  memset(memo, -1, sizeof memo);
  int ans = dp(0, 1000);
  printf("%d", ans);
}
