N = int(input())
A = list(map(int,input().split()))
money = 1000
start = 0
while True:
    for i in range(start,N):
        if A[i] > A[start]:
            stock = money // min(A[start:i])
            amari = money % min(A[start:i])
            for j in range(i,N):
                if j == N-1:
                    money = amari + stock*max(A[i:N])
                    print(money)
                    exit()
                if A[j] < A[i]:
                    money = amari + stock*max(A[i:j])
                    stock = 0
                    amari = 0
                    start = j
                    break
            break
        if i == N-1:
            start += 1
    if start == N-1:
        print(money)
        exit()