#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 = dp(day + 1, money);
  for (int i = day + 1; i < n; ++i) {
    int profit = (money / a[day]) * (a[i] - a[day]);
    if (profit < 0) continue;
    tmp = max(tmp, dp(i + 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);
}
