n = int(input())
a = list(map(int, input().split()))

money = 1000
stock = 0
leave_max = max(a[1:])

for i in range(n):
    if i == n-1:
        money += a[i] * stock
        break

    leave_max = max(a[i+1:])

    if a[i] >= a[i+1]:
        money += a[i] * stock
        stock = 0
        if a[i] > leave_max:
            break
        else:
            continue

    elif a[i] < a[i+1]:
        num = money // a[i]
        if num != 0:
            stock += num
            money -= stock * a[i]

print(money)
