# coding: utf-8
# Your code here!
n = int(input())
a = list(map(int,input().split()))
money = 1000
have = 0
buy = 0
c = []
check = a[0]
start = False
check2 = -1
for i in range(1,n):
    if check2 > a[i] and start:
        c.append((check,check2))
        check = a[i]
        check2 = -1
        #print(i)
    elif check2 <= a[i] and start:
        check2 = a[i]
    elif check < a[i] and not start:
        check2 = a[i]
        start = True
    elif check >= a[i] and not start:
        check = a[i]
    #print(check,check2)
if check2 != -1 and check != check2:
    c.append((check,check2))
#print(c)
for i in c:
    have = money//i[0]
    money -= i[0]*have
    money += have * i[1]
print(money)