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

stockNo = 0
money = 1000
procedure = []

for i in range(N):
  if i == 0:
    if a[i] < a[i+1]:
      procedure.append("buy")
    else:
      procedure.append("stay")
  elif i <= N-2:
    if a[i] <= a[i-1] and a[i] > a[i+1]:
      procedure.append("cell")
    elif a[i] >= a[i-1] and a[i] < a[i+1]:
      procedure.append("buy")
    else:
      procedure.append("stay")
  else:
    procedure.append("cell")
    
for i in range(N):
  if procedure[i] == "buy":
    while money >= a[i]:
      money -= a[i]
      stockNo += 1
  if procedure[i] == "cell":
    while stockNo > 0:
      money += a[i]
      stockNo -= 1
print(money)