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

stair = []
startDate = 0
firstFlag = True
for i in range(1, N):
    if (A[i] == A[i - 1]):
        stair.append(0)
        continue
    if (A[i] < A[i - 1]):
        stair.append(-1)
    else:
        if (firstFlag):
            firstFlag = False
            startDate = i - 1
        stair.append(1)

upflag = False
base = 1000
ticket = 0
for i in range(startDate, N - 1):
    if (stair[i] == 0):
        continue
    if (upflag):
        if (stair[i] == -1):
            base += ticket * A[i]
            upflag = False
    else:
        if (stair[i] == 1):
            ticket = int(base / A[i])
            base -= ticket * A[i]
            upflag = True

if (ticket != 0):
    base += ticket * A[N - 1]

print(base)