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

yen = 1000
stocks = 0

for i in range(N):
  if i == N-1:
    yen += stocks * A[i]
    stocks = 0
    break
  
  if A[i] > A[i-1]:
    # sell everything
    yen += stocks * A[i]
    stocks = 0
  else:
    # buy everything
    num = yen // A[i]
    stocks += num
    yen -= A[i] * num

print(yen)