n=int(input())
a=list(map(int,input().split()))
m=1000
k=0
peak=0
for i in range(n-1):
    if a[i]<a[i+1]:
        peak=i+1
#print(peak)
for i in range(peak):
    if a[i+1]>=a[i]:
        k=m//a[i]
        m-=k*a[i]
#        print(k,m)
    elif a[i+1]<a[i]:
        m+=k*a[i]
        k=0
#        print(k,m)
if peak==n-1:
    m+=k*a[peak]
    k=0
#    print(k,m)
print(m)
