N = int(input())
A = list(map(int,input().split()))
money = 1000
kabu = 0
A0 = A[0]
if min(A) == A0:
    kazu = int(money/A0)
    kabu += kazu
    money -= kazu * A0
    #print(money,kabu)

for i in range(1,N-1):
    #print(A[i])
    Ai = A[i]
    if A[i-1] < Ai:
        money += kabu*A[i]
        kabu = 0
        #print(money,kabu)
    if min(A[i:]) == A[i]:
        Ai = A[i]
        kazu = int(money/Ai)
        kabu += kazu
        money -= kazu * Ai
        #print(money,kabu)
AN = A[N-1]
if A[N-2] < AN:
    money += kabu*AN
    kabu = 0
    #print(money,kabu)

print(money)
