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

A.append(0)

en = 1000
kabu = 0

for i in range(N):
    if A[i] < A[i+1]:
        kabu = en//A[i]
        en %= A[i]
    if A[i] > A[i+1]:
        en += kabu*A[i]
        kabu = 0

print(en)