N = int(input())
line  = list(map(int, input().split()))
money = 1000
k = line[0]
ln = [line[0]]
for i in range(1,N):
    if line[i] != ln[-1]:
        ln.append(line[i])
#print(ln)
while len(ln) > 1:
    if ln[0] >  ln[1]:
        ln = ln[1:]
    else:
        break
#print(ln)
while len(ln) > 1:
    if ln[-1] < ln[-2]:
        ln = ln[:-2]
    else:
        break
        
st = True        
ln1= [ ]
for i in range(len(ln)-1):
    #print(ln[i] - ln[i+1] <0 == st)
    if (ln[i] - ln[i+1] <0 )== st :
        ln1.append(ln[i])
        st = not st
ln1.append(ln[-1])
#print(ln1)

for i in range(int(len(ln1)/2)):
    money = ln1[2*i +1] * int(money / ln1[2*i]) + (money %ln1[2*i])
    #print(money)
print(money)
    
