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

money = 1000
num = 0
buy_p = 0
i = 0

while(i<N-1):
    if A[i] >= A[i+1]:
        i += 1
        continue
    elif i == N-2:
        if A[i] < A[N-1]:
            num = money // A[i]
            money -= A[i] * num
            money += A[N-1] * num
        break
    for j in range(i+1, N):
        if A[j-1] > A[j]:
            num = money // A[i]
            money -= A[i] * num
            money += A[j-1] * num
            i = j
            break

print(money)
