N = int(input())
A = list(map(int, input().split()))
acd = A[0] <= A[1]
lst = [A[0]]
i = 1
while i < N:
    if acd:
        if A[i-1] > A[i]:
            lst.append(A[i-1])
            acd = 0
    else:
        if A[i-1] < A[i]:
            lst.append(A[i-1])
            acd = 1
    i += 1
if A[N-2] < A[N-1]:
    lst.append(A[N-1])
if len(lst) == 1:
    print(1000)
    exit()
if lst[0] > lst[1]:
    lst = lst[1:]
if len(lst) < 2:
    X = 1000
else:
    X = 1000
    for i in range(0, len(lst), 2):
        c = X//lst[i]
        X -= c*lst[i]
        X += c*lst[i+1]
print(X)