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

money = 1000
kabu = 0

for i in range(N):
    a = A[i]
    nokori = sorted(A[i:])
    if kabu == 0:
        if a < nokori[-1]:
            buy = money // a
            money -= buy * a
            kabu += buy
    else:
        if a != nokori[0] or i == N-1:
            money += kabu * a
            kabu = 0
    # print(money, kabu)

print(money)