N = int(input())
As = list(map(int, input().split()))
judge = As[0]
preans = []
hand = 1000
kabu = 0
while As:
    a = As.pop(0)
    if a <= judge:
        preans.append(a)
    else:
        buy = min(preans)
        while hand >= buy:
            kabu += 1
            hand-= buy
        hand += kabu * a
        judge = a
        kabu = 0
        preans = []
print(hand)