N = int(input())
A = list(map(int, input().split()))
m = 1000
s = 0
flag = "e"
idx = 0
for i in range(N-1):
  if A[i]<A[i+1] and (flag == "d" or flag == "e"):
    s += m//A[i]
    m = m%A[i]
    flag = "u"
  elif A[i]>A[i+1] and (flag == "u" or flag == "e"):
    m += s*A[i]
    s = 0
    idx = i
    flag = "d"
  elif A[i]==A[i+1]:
    flag = "e"
    
m += s*max([A[idx],A[N-1]])

print(m)