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
values = list(Counter(a).keys())
# print(values)
m = len(values)
for i in range(m):
    if i+1 < m:
        # print(values[i+1])
        if values[i] < values[i+1]:
            # 買う
            ans, kabu = ans % values[i], ans // values[i]
            # print(f'{(ans, kabu)=}')
        elif values[i] > values[i+1]:
            # 売る
            ans, kabu = ans + values[i] * kabu, 0
    else:
        if values[i-1] < values[i]:
            # 売る
            ans, kabu = ans + values[i] * kabu, 0
print(ans)
