def resolve():
    D = int(input())
    A = [int(i) for i in input().split()]
    stock = 0
    N = 1000
    for i in range(D - 1):
        if A[i] < A[i + 1]:
            # 購入
            stock = N // A[i]
            N -= A[i] * stock
        elif stock > 0:
            # 売却
            N += stock * A[i]
            stock = 0
        else:
            continue
    if stock > 0:
        # 売却
        N += stock * A[-1]
        stock = 0
    print(N)

resolve()
