a = int(input())
data = list(map(int, input().split()))
l =[]
money = 1000
stock = 0

for i in data:
  if i not in l:
    l += [i]

diff = []
dd = []
for i in range(len(l) - 1):
  if l[i] < l[i + 1]:
    if not diff:
      diff += [l[i + 1] - l[i]]
      dd += [[l[i + 1], l[i]]]
    elif diff[-1] < l[i + 1] - l[i]:
      diff += [l[i + 1] - l[i]]
      dd += [[l[i + 1], l[i]]]

for d in dd:
  stock = money // d[1]
  money -= stock * d[1]
  money += stock * d[0]
  stock = 0
print(money)