N = int(input())
A = [int(a) for a in input().split()]

ans = 1000
m = 1000
s = 0

for i in range(N):
    f = 0
    for j in range(i+1, N):
        if A[j] <= A[i] and f == 0:
            f = 1
        elif A[j] >= A[i] and f == 1:
            f = 2

    if f <= 1:
        s += m//A[i]
        m %= A[i]
    elif f == 2:
        m += s*A[i]
        s = 0
    ans = max(ans, m+s*A[i])

print(ans)