N=int(input())
a_list=list(map(int,input().split()))
K=1000//a_list[0]
L=1000-K*a_list[0]
sum=K*a_list[0]
for i in range(N-1):
    if   a_list[i]<a_list[i+1]:
        sum=K*a_list[i+1]+L
        K=0
        L=0
    elif a_list[i]>a_list[i+1]:
        K=sum//a_list[i+1]
        L=sum-K*a_list[i+1]
print(sum)