n=int(input())
a=list(map(int,input().split()))
b=[0]
for i in range(n-1):
    if a[i]<a[i+1]:
        b.append(1)
    elif a[i]==a[i+1]:
        b.append(b[-1])
    else:
        b.append(-1)
b.append(-100)
c,d=1000,0
for i in range(n):
    if b[i+1]>b[i]:
        d+=c//a[i]
        c=c%a[i]
    else:
        c+=d*a[i]
        d=0
print(c)