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

movements = ['bull' if A[i+1]>A[i] else 'bear' for i in range(N-1)]
movements.append('bear')
movements.insert(0, 'bear')

money = 1000
stock = 0
for i in range(1, N+1):
    if movements[i-1] == 'bear' and movements[i] == 'bull':
        stock = money // A[i-1]
        money = money % A[i-1]
    elif stock > 0:
        money += A[i-1] * stock
        stock = 0
    else:
        pass

print(money)
