#n,k=map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
en=1000
kab=0
yamaf=False
tanif=False
for i in range(len(a)-1):
  if a[i]>a[i+1] and kab>0:
    en+=kab*a[i]
  
  if a[i]<a[i+1]:
    j=i
    kab=en//a[i]
    en=en-kab*a[i]
en+=kab*a[-1]
    
print(en)