n = int(input())
a = list(map(int, input().split()))
a.insert(0, a[0])
a.append(a[-1])
INF = 10 ** 9 + 7

money = 1000
mi = INF
ma = 0
for i in range(1, n + 1):
    mi = min(mi, a[i])
    ma = max(ma, a[i])
    if a[i - 1] < a[i] >= a[i + 1]:
        stock = money // mi
        money %= mi
        money += stock * ma
        mi = a[i]
        ma = a[i]

print(money)