N = int(input())
*A, = map(int, input().split())
stack = [(1000, 0, 0, True)]
ans = 1000
while stack:
    money, stock, day, buy = stack.pop()
    if day >= N: ans = max(ans, money); continue
    if buy:
        while day < N - 1 and A[day] >= A[day + 1]:
            day += 1
        st, mon = divmod(money, A[day])
        stack.append((mon, st, day + 1, False))
    else:
        while day < N - 1 and A[day] <= A[day + 1]:
            day += 1
        st = 0; mon = money + A[day] * stock
        stack.append((mon, st, day + 1, True))
print(ans)