N = int(input())
A = list(map(int,input().split())) + [0]
kabu = 0
money = 1000

for p in range(N):
    #株がない時
    if A[p] < A[p+1]:
        kabu = money//A[p]
        money -= kabu*A[p]
    
    #株があるとき
    elif A[p] > A[p+1]:
        money += kabu*A[p]
        kabu = 0

print(money)