import copy
N = int(input())
A = list(map(int, input().split()))
B=[A[0]]
for i in range(1,N):
    if A[i-1]!=A[i]:
        B.append(A[i])

C = copy.deepcopy(B)
for i in range(len(B)-1):
    if  B[i]>B[i+1]:
        C[i]=0 
    else:
        break
C=[s for s in C if s != 0]
#print(C)
C.reverse()
for i in range(len(C)-1):
    if  C[i]<C[i+1]:
        C[i]=0 
    else:
        break
C=[s for s in C if s != 0]
C.reverse()
#print(C)
kane=1000
kabu=0
for i in range(len(C)-1):
    if C[i]<C[i+1]:
        kabu=kane//C[i]
        kane=kane-kabu*C[i]
    else:
        kane=kane+C[i]*kabu
kane=kane+kabu*C[len(C)-1]
print(kane)