n = int(input())
a = list(map(int, input().split()))
money = 1000
stock = 0
flag = 1
for i in range(n - 1):
    if i != 0:
        if a[i - 1] == a[i]:
            continue
    if flag:
        if a[i] < max(a[i + 1:]):
            stock += money // a[i]
            money -= stock * a[i]
            flag ^= 1
    else:
        if a[i] > min(a[i + 1:]):
            money += stock * a[i]
            stock = 0
            flag ^= 1

if stock != 0:
    money += stock * a[-1]
print(money)