n = int(input())
A = list(map(int, input().split()))
money = 1000
cnt = 0
x = ""
b = ""
for a in A:
    if b == "": b = a
    else:
        if b == a: continue
        else: b = a
    
    if x != "" and a < x:
        money += cnt * x
        cnt = 0
        x = ""

    if x == "":
        cnt = money//a
        money -= cnt * a
        x = a
    else:
        if a > x:
            money += cnt * a
            cnt = 0
            x = ""
if cnt > 0: money += cnt * x
print(money)