n = int(input())
a_li = list(map(int,input().split()))
low = a_li[0]
high = a_li[0]
old = a_li[0]
yen = 1000
for i in range(1,n):
    if low < a_li[i]:
        if old <= a_li[i]:
            high = a_li[i]
        else:
            div,yen = divmod(yen,low)
            yen += div*high
            low = a_li[i]
    old = a_li[i]
if low < high:
    div, yen = divmod(yen, low)
    yen += div * high
    low = a_li[i]
print(yen)