N = int(input())
A = list(map(int,input().split()))

ans = 1000
diff = [0 for _ in range(N)]

for i in range(1, N):
    if A[i] == A[i - 1]:  diff[i] = 0
    elif A[i] > A[i - 1]: diff[i] = 1
    else:  diff[i] = -1

money = 1000
kabu = 0

for i in range(1, N):
    if kabu == 0:
        if diff[i] == 1:
            kabu = money // A[i - 1]
            money = money - A[i - 1] * kabu
    else:
        if diff[i] == -1:
            money = kabu * A[i - 1]
            kabu = 0
    
    ans = max(ans, money)

money += kabu * A[-1]
ans = max(ans, money)
print(ans)