import itertools
#n, k = map(int,input().split())
n = int(input())
al = list(map(int,input().split()))

ans = 0
for v in itertools.product(range(2),repeat=n):
    money = 1000
    kabu = 0

    for i in range(n):
        if v[i] == 0:
            kabu += money // al[i]
            money = money % al[i]
        elif v[i] == 1:
            money += kabu * al[i]
            kabu = 0
        else:
            continue
    ans = max(ans, money)
print(ans)
