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

wallet = 1000
stock = 0

for i in range(N - 1):
    if A[i] < A[i + 1] and wallet > 0:  # 次値上がり and 金がある→買う
        action = wallet // A[i] 
        if wallet >= action * A[i]:
            stock += wallet // A[i]
            wallet -= stock * A[i]
    elif A[i] > A[i + 1] and stock > 0:  # 次値下がり and 株持っている→売り
        wallet += stock * A[i]
        stock = 0

# 最後残っていたら全部売る
wallet += stock * A[-1]

print(wallet)
