N, *A = map(int, open(0).read().split())
rising_terms = []
tmp = []
for i in range(N - 1):
    if A[i] <= A[i + 1]:
        tmp.append(A[i])
    elif tmp:
        rising_terms.append(tmp)
        tmp = []
if A[N - 2] <= A[N - 1]:
    rising_terms.append(tmp + [A[N - 1]])
ans = 1000
for rising_term in rising_terms:
    stock, r_money = divmod(ans, rising_term[0])
    ans = r_money + stock * rising_term[-1]
print(ans)
