N = int(input())
A = [int(x) for x in input().split()]
A.append(0)
f = [0] * N
for i in range(N):
    if A[i] < A[i+1]:
        f[i] = 1
    elif A[i] > A[i+1]:
        f[i] = 2
cnt = 1000
stock = 0
prev = 0
for i in range(N):
    if prev != 1 and f[i] == 1:
        stock = cnt // A[i]
        cnt %= A[i]
    elif prev != 2 and f[i] == 2:
        cnt += stock * A[i]
        stock = 0
    prev = f[i]
print(cnt)
