N = int(input())
A = [300] + list(map(int, input().split())) + [0]
m = 1000
c = 0

if max(A[1:]) == A[1]:
    print(m)
else:
    B = [['-', '+'][i < j] for i, j in zip(A, A[1:])]
    B = ''.join(B)
    o = []
    for i in range(len(B) - 1):
        b = B[i:i + 2]
        if b == '-+':
            o.append((i, 'B'))
        elif b == '+-':
            o.append((i, 'S'))

    A = A[1: -1]
    for x, y in o:
        #print(x, y)
        if y == 'B':
            tmp = m // A[x]
            c += tmp
            m -= tmp * A[x]
        else:
            m += c * A[x]
            c = 0

    print(m)