# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
money = 1000
num = 0 
pre_price = 0
INF = 10 **31
for i in range(N):
    low_flag = False
    high_flag = False
    money += A[i]*num
    num = 0
    last_high = 0
    ini_low = INF
    for j in range(i+1,N):
        if A[i] < A[j]:
            high_flag = True
            last_high = max(j,last_high)
        if A[i] > A[j]:
            low_flag = True
            ini_low = min(j,ini_low)
    if high_flag and low_flag:
        if last_high < ini_low:
            tmp_num = money // A[i]
            price = tmp_num * A[i]
            money -= price
            num += tmp_num
            pre_price = A[i]
    if high_flag and low_flag == False:
        tmp_num = money // A[i]
        price = tmp_num * A[i]
        money -= price
        num += tmp_num
        pre_price = A[i]
print(money)