N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
uri = 0
if N ==1:
  print(syoji)
  exit()
sw = 0
for i in range(N):
  if i<N-1 and kabu == 0 and A[i] < A [i+1]:
    for j in range(i+1,N):
      if sw ==1 and uri >= A[j]:
        break
 
      elif  A[i] < A[j]:
        uri = A[j]
        sw = 1
 
    if sw ==1:
    	kabu = syoji // A[i]
        syoji = syoji - (num-1)*A[i]
        kai = A[i]
        sw = 0
  elif kabu > 0 and A[i]==uri:
    syoji = syoji + kabu*A[i]
    kabu = 0
    uri = 0
 
        
print(syoji)