n=int(input())
#n,k=map(int,input().split())
v=list(map(int,input().split()))
l=list()
for i in v:
  if i not in l:
    l.append(i)
n=len(l)
d=list()
if l[0]>l[1]:
    d.append(l[0])
if l[0]<l[1]:
    d.append(l[0])
for i in range(1,n-1):
  if l[i-1]<l[i] and l[i+1]<l[i]:
    d.append(l[i])
  if l[i-1]>l[i] and l[i+1]>l[i]:
    d.append(l[i])
if l[-1]>l[-2]:
    d.append(l[-1])
if l[-1]<l[-2]:
    d.append(l[-1])
#print(d)
n=len(d)
p=1000
for i in range(1,n):
  if l[i-1]<l[i]:
    z=(p//l[i-1])*l[i]
    r=p%l[i-1]
    p=z+r
print(p)
    


