from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

money = 1000
stock = 0
if A[0] < A[1]:
    stock += (money//A[0])
    money %= A[0]
    
tmp = A[0]
cnt = 1

while True:
    if A[cnt] > A[cnt-1]:
        while True:
            cnt += 1
            if cnt >= N-1:
                break
            if A[cnt+1] < A[cnt]:
                break
        if cnt >= N-1:
            break
        money += (stock*A[cnt])
        stock = 0
    else:
        while True:
            cnt += 1
            if cnt >= N-1:
                break
            if A[cnt+1] > A[cnt]:
                break
        if cnt >= N-1:
            break
        stock += (money//A[cnt])
        money %= A[cnt]
    if cnt >= N-1:
        break
money += (stock*A[-1])
print(max(money,1000))