import sys
sys.setrecursionlimit(4100000)

N = int(input())
A = list(map(int, input().split()))
ans = 1000


def dfs(day, money,stock):
    if day == N:
        asn = max(ans, money+ stock * A[N-1])
        return
    price = A[day-1]
    dfs(day+1, money % price, stock + money//price)
    #dfs(day+1, money, stock)
    dfs(day+1, money + stock * price, 0)
    return

dfs(1,1000,0)

print(ans)


