N = int(input())

A = list(map(int,input().split()))

a = 0
b = 0
Money = 1000

for i in range(len(A)):
  if a == 0:
    a = A[i]
    continue
  if b <= A[i] or b == 0:
    b = A[i]
    continue
  else:
    if a < b:
      Money = Money // a * b + Money % a
    a = b = A[i+1]
    
if a < b:
      Money = Money // a * b + Money % a
print(Money)