N = int(input())
a_list = list(map(int, input().split()))

mon = 1000
stock = 0

lim_a = [a_list[0]]
for i in range(1,N-1):
    if lim_a[-1] == a_list[i]:
        continue
    if a_list[i] <= a_list[i+1] and a_list[i] <= a_list[i-1]:
        lim_a.append(a_list[i])
    elif a_list[i] >= a_list[i+1] and a_list[i] >= a_list[i-1]:
        lim_a.append(a_list[i])

if len(lim_a) >= 2:
    if lim_a[-2] <= lim_a[-1] <= a_list[-1]:
        lim_a[-1] = a_list[-1]
    elif lim_a[-2] >= lim_a[-1] >= a_list[-1]:
        lim_a[-1] = a_list[-1]
    else:
        lim_a.append(a_list[-1])
else:
    
    lim_a.append(a_list[-1])


s = 0 if lim_a[0] < lim_a[1] else 1
e = 0 if lim_a[-2] < lim_a[-1] else 1
for i in range(s, len(lim_a)-e):
    if (i + s)%2 == 0:
        # buy
        stock += mon//lim_a[i]
        mon -= lim_a[i] * stock
    else:
        # sell
        mon += lim_a[i] * stock
        stock = 0

print(max(mon, 1000))

