import math
a = input()
b = input().split(" ")
c = []
for i in b:
  c.append(i)
money = 1000
senet = 0
chk = 0
c.sort(reverse=True)
for i in range(int(a)):
  for j in range(int(a)):
    if j != int(a)-1:
      if b[j] > b[j+1]:
        pass;
      else:
        chk = 1 
  if chk == 0:
    break;
  elif i == int(a)-1:
    if senet != 0:
      money = money + (senet * int(b[i]))
    else:
      pass;
  elif i == 0:
    senet += math.floor(money / int(b[i]))
    money = money-(math.floor(money / int(b[i]))*int(b[i]))
  elif int(b[i]) < int(b[i+1]):
    senet += math.floor(money / int(b[i]))
    money = money-(math.floor(money / int(b[i]))*int(b[i]))
  elif int(b[i]) > int(b[i+1]):
    if c[0] > b[i]:
      money += senet * int(b[i])
      senet = 0 
    else:
      pass
  elif int(b[i]) == int(b[i+1]):
    pass;
print(money)