n = int(input())
L = list(map(int,input().split()))


a = 1000
k = 0

for i in range(n-1):
    if L[i]<L[i+1]:
        k = a//L[i]
        a = a-L[i]*k
    elif L[i]>L[i+1] and k > 0:
        a = a + L[i]*k
        k = 0
else:
    if k > 0:
        a = a + L[n-1]*k

print(a)    

