n=int(input())
a=list(map(int,input().split()))

mo=1000
ch=0
tu=0
for i in range(1,n):
  if a[i-1]<=a[i]:
    ch+=1
  if a[i-1]>a[i] and ch>0:
    y=min(a[:i])
    ka=mo//y
    mo=mo-ka*y
    mo=mo+a[i-1]*ka
    tu=i
  if i==n-1:
    if a[i-1]<a[i]:
      y=a[i-1]
      ka=mo//y
      mo=mo-ka*y
      mo=mo+a[i]*ka
  
    
print(mo)