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

money = 1000
kabu = 0
sell = -1
for i in range(N):
    if i == sell:
        money += kabu*A[i]
        kabu = 0
        continue

    # 翌日のほうが安いならスキップ
    if i < N-2 and A[i] >= A[i+1]:
        continue

    # 翌日以降に値上がりするか
    for j in range(i+1, N):
        # 値上がりするなら買えるだけ買う
        if A[i] < A[j]:
            kabu = money//A[i]
            money -= (money//A[i])*A[i]

            # 売る日を求める
            for k in range(i+1, N):
                if A[k-1] <= A[k]:
                    sell = k
                else:
                    break
            break
print(money)
