def solve():
    N = int(input())
    A_org = list(map(int,input().split()))
    A = [A_org[0]]
    isPosPrev = False
    for i in range(N-1):
        if A_org[i] == A_org[i+1]:
            continue

        isPosNow = True if A_org[i] < A_org[i+1] else False

        if i == 0:
            isPosPrev = isPosNow

        if isPosNow != isPosPrev:
            A.append(A_org[i])
        
        isPosPrev = isPosNow
    else:
        A.append(A_org[-1])
    
    if A[0] > A[1]:
        A = A[1:]

    N = len(A)
    money = 1000
    for i in range(0,N,2):
        if i+1 >= N:
            break
        money = money // A[i] * A[i+1] +  money % A[i]
    
    print(money)
        
if __name__ == '__main__':
    solve()