N = int(input())
A_list = [int(e) for e in input().split()]

#極大・極小のところのみを取り出す
compressed_A = list()
compressed_A.append(A_list[0])
for i in range(1,N-1):
    if A_list[i-1] <= A_list[i] >= A_list[i+1] or A_list[i-1] >= A_list[i] <= A_list[i+1]:
        compressed_A.append(A_list[i])
        
if len(compressed_A)>=2:
    if compressed_A[-2] <= compressed_A[-1] < A_list[-1]:
        compressed_A.pop(-1)
        compressed_A.append(A_list[-1])
else:
    compressed_A.append(A_list[-1])
    
#重複の削除
more_compressed_A = list()
for i in range(len(compressed_A)-1):
    if compressed_A[i] != compressed_A[i+1]:
        more_compressed_A.append(compressed_A[i])
if compressed_A[-2] != compressed_A[-1]:
    more_compressed_A.append(compressed_A[-1])

#実際に売買する
money = 1000
for i in range(len(more_compressed_A)-1):
    if more_compressed_A[i] < more_compressed_A[i+1]:
        money += (more_compressed_A[i+1]-more_compressed_A[i])*(money//more_compressed_A[i])

print(money)