import numpy as np
n = int(input())
a = list(map(int, input().split()))

tmp = [1000]
a= np.array(a)

for i in range(n-1):
    if a[i]>a[i+1]:
        pass
    else:
        tmp=a[i:]
        break

ans=1000
hand=0

if len(tmp)==1:
    print(1000)
    
else:
    am = np.diff(tmp)
    a = tmp[1:][am!=0]
    am= am[am!=0]
    hand = ans//tmp[0]
    ans = ans%tmp[0]
    for i in range(len(a)):
        if am[i]<0:
            hand = ans//a[i]
            ans = ans%a[i]
        else:
            ans=ans+a[i]*hand
            hand = 0
    print(ans+a[i]*hand)