from collections import Counter
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')

n = I()
a = LI()
ans = 1000
kabu = 0
vs = list(Counter(a).keys())
i = 0
m = len(vs)
# 極小値で売る、極大値で買う
while i < m:
    if 0 < i < m - 1:
        if vs[i-1] > vs[i] < vs[i+1]:
            # 買う
            ans, kabu = ans % vs[i], ans // vs[i]
            # print(i, ans, kabu)

        elif vs[i-1] < vs[i] > vs[i+1]:
            # 売る
            ans, kabu = ans + vs[i] * kabu, 0
            # print(i, ans, kabu)
    else:
        if i == 0:
            if vs[i] < vs[i+1]:
                # 買う
                ans, kabu = ans % vs[i], ans // vs[i]
                # print(i, ans, kabu)
        else:
            if vs[i - 1] < vs[i]:
                # 売る
                ans, kabu = ans + vs[i] * kabu, 0
                # print(i, ans, kabu)
    i += 1
# print(i)

print(ans)
