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

res = 1000

for i in range(n):
    tmp = 1000
    s = 0
    flag = 1
    price = 300
    for j in range(i, n):
        if flag and price > a[j]:
            s = tmp//a[j]
            tmp -= a[j]*s
            price = a[j]
            flag = 0
        elif flag == 0 and price < a[j]:
            tmp += a[j]*s
            s = 0
            price = a[j]
            flag = 1
        res = max(tmp, res)

print(res)