n= int(input())
a = list(map(int,input().split()))
o = {}
for i in a:
    if not i in o:
        o[i] = 0
a = []
for i in o:
    a.append(i)
money = 1000
buy = 0
have = 0
for i in a:
    if i == max(a):
        money += have * i
        break
    if have == 0:
        have = money // i
        money -= i*have
        buy = i
    elif buy < i:
        money += i*have
        have = 0
print(money)