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

m = 1000
k = 0
up = False
down = False

for i in range(n-1):
  to = i+1
  if a[i] == a[to]:
    continue
  if a[i] > a[to]:
    while to+1 < n and a[to] < a[to+1]:
      to += 1
      
    if to == n-1:
      break
    i = to - 1
  else:
    while to+1 < n and a[to] < a[to+1]:
      to += 1
      
    k = m // a[i]
    m = m - k*a[i] + k*a[to]
    
    i = to - 1
    
print(m)
