n=int(input())
a=list(map(int,input().split()))
num=1000
num2=0
num3=-1
if max(a)!=a[0]:
    for i in range(1,n):
        if a[i-1]<a[i] and num3==-1:
            num2+=num//a[i-1]
            num-=a[i-1]*(num//a[i-1])
            num3=a[i]
        elif num3!=-1:
            if a[i-1]<a[i]:
                num3=a[i]
            if a[i-1]>a[i]:
                num+=a[i-1]*num2
                num2=0
                num3=-1
num+=max(a[-1],a[-2])*num2
print(num)
