import sys
input = sys.stdin.buffer.readline

n = int(input())
a = list(map(int,input().split()))

#kane ha
b = 1000

#kabu ha
p = 0
q = 0

for e in a:
    q += p//e
    p = p%e

    b = max(b,p + q*e)

    if b // e > q:
        p = b%e
        q = b//e

print(b)