n = int(input())
A = tuple(map(int, input().split()))
m = 1000
kabu = 0
for pa, aa in zip(A[:n], A[1:]):
    if pa < aa:
        # buy all
        kabu, m = divmod(m, pa)
    elif pa > aa:
        # sel all
        m += kabu * pa
        kabu = 0

if kabu > 0:
    m += kabu*aa

print(m)
