N = int(input())
A = list(map(int, input().split()))
A.append(0)
money = 1000
kabu = 0
for i in range(N):
    if A[i] < A[i+1]:
        kabu = money//A[i]
        money -= kabu*A[i]
    else:
        money += kabu*A[i]
        kabu = 0
print(money)

