n = int(input())
list_A = list(map(int, input().split()))
list_N = [0]
money = 1000
for i in range(1, n):
    if list_A[i-1] < list_A[i]:
        list_N.append(1)
    else:
        list_N.append(0)


k = 0
while True:
    if k == n-1:
        break
    k += 1
    if list_N[k-1] == 0 and list_N[k] == 1:
        l = k-1
        while True:
            if k+1 == n or list_N[k] == 0:
                break
            k += 1
        roll = money // list_A[l]
        money = money % list_A[l]
        money += list_A[k]*roll

print(money)