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