n=int(input())
ar=list(map(int,input().split()))
c=1000
p=0
cur=0
prev=0
for i in range(n):
    if i!=n-1 and ar[i+1]>ar[i]:
        prev=ar[i]
        cur=c//ar[i]
        c=c%ar[i]
##        print(i,'b')
    if i!=0 and ar[i]>ar[i-1]:
        p+=ar[i]*cur-prev*cur
        c+=cur*ar[i]
        cur=0
##        print(i,'s')
##    print(ar[i])
if cur!=0:
    c+=ar[-1]*cur
print(c)
