n = int(input())
a=list(map(int,input().split()))
kane=1000
kabu =0

sa=[a[i+1]-a[i] for i in range(n-1)]
hr=0
for i in range(n-1):
    if hr ==0:
        if sa[i]>0:
            kabu = kane//a[i]
            kane=kane%a[i]
            hr=1
        elif sa[i]==0:
            hr=0
        else:
            kane+=kabu*a[i]
            hr=2
    elif hr==1:
        if sa[i]<0:
            kane +=kabu*a[i]
            hr=2
        elif sa[i]==0:
            hr=0
        else:
            hr=1
    else:
        if sa[i]>0:
            kabu = kane//a[i]
            kane=kane%a[i]
            hr=1
        elif sa[i]==0:
            hr=0
        else:
            hr=2

print(kane+kabu*a[n-1])