import sys

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))

pre = 300
money = 1000
num = 0

for i, a in enumerate(A):
    if a < pre and not all([a > aa for aa in A[i + 1:]]):
        pre = a
        num = money // a
        money %= a
    elif a > pre:
        pre = a
        money += num * a
        num = 0

print(money + num * A[-1])
