INF = 10 ** 10
n = int(input())
a = [INF] + list(map(int, input().split())) + [-INF]
l = []
for i in range(n):
    if len(l) % 2 == 0:
        if a[i] > a[i + 1] <= a[i + 2]:
            l.append(a[i + 1])
    else:
        if a[i] < a[i + 1] >= a[i + 2]:
            l.append(a[i + 1])
t = 1000
for i in range(0, len(l), 2):
    t = t // l[i] * l[i + 1] + t % l[i]
print(t)
