n=int(input())
A=list(map(int,input().split()))
money=1000
stock=0
buy=0
flag=0
sell=300
if A[0]==max(A):
  print(money)
else:
  for i in range(n):
    if A[i]>buy and stock>0:
      money+=stock*A[i]
      stock=0
      sell=A[i]
      if sell==max(A[i:n+1]):
        flag=1
    elif A[i]<sell and flag==0:
      stock=money//A[i]
      money-=stock*A[i]
      buy=A[i]
      sell=0
  print(money)