def solve():
    n = int(input())
    a = list(map(int, input().split()))
    s = [0] * n
    for i in range(n - 1):
        if a[i + 1] > a[i]:
            s[i + 1] = 1
        elif a[i + 1] == a[i]:
            continue
        else:
            s[i + 1] = -1
    #print(s)
    tak = 1000
    stock = 0
    for i in range(n - 1):
        if s[i + 1] == 1 and not stock:
            stock = tak // a[i]
            tak = tak % a[i]
        elif s[i + 1] == -1 and stock:
            tak += stock * a[i]
            stock = 0
    if s[-1] == 1:
        tak += a[-1] * stock
    print(tak)

solve()
