# coding: utf-8


N = int(input())
List = list(map(int, input().split()))
SUMList=[]

F=List[0]
check=0
for k in range(N):
    if List[k]<=F:
        check+=1
if check==N:
    print(1000)
    quit()


for i in range(N):
    List[i]
    cnt=0
    M=1000
    for j in range(i,N):
        if cnt==0:
            KABU=M//List[j]
            M=M%List[j]
            MAE=List[j]
            #print("A",KABU,M)
        elif (j+1)==N:
            M=M+(KABU*List[j])
            MAE=List[j]
            KABU=0
            cnt=0
            #print("D",KABU,M)

        elif List[j]>MAE:
            M=M+(KABU*List[j])
            MAE=List[j]
            KABU=0
            cnt=0
            #print("B",KABU,M)
        elif List[j]<MAE and (j+1)!=N:
            KABU=KABU+(M//List[j])
            M=M%List[j]
            MAE=List[j]
            #print("C",KABU,M)
        else:
            #print("E",KABU,M)
            pass
        #print(KABU,M)
        cnt+=1
        #print(M)
        
    SUMList.append(M)
    #print("AAAAAAAAAAAAAA")
    
print(max(SUMList))
    
