N = int(input())
A = list(map(int, input().split()))
for k in range(N-1):
  if A[k] == A[k+1]:
    A[k] = 0
B = []
for l in A:
  if l != 0:
    B.append(l)
n = len(B)

money = 1000
mx = []
mi = []
if B[0] < B[1]:
  mi.append(B[0])
for i in range(1,n-1):
  if B[i] > B[i-1] and B[i] > B[i+1]:
    mx.append(B[i])
  if B[i] < B[i-1] and B[i] < B[i+1]:
    mi.append(B[i])
if B[n-1] > B[n-2]:
  mx.append(B[n-1])
  
for j in range(len(mx)):
  konyu = money // mi[j]
  money += (mx[j] - mi[j]) * konyu

print(money) 