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

m = 1000
k = 0

for i in range(n):
    if A[i] <= m and A[i] == min(A) and i != n-1:
        # 全体で最安なら買い
        k = m//A[i]
        m = m- A[i]*k
    elif A[i] < m and A[i] < max(A[i::]) and i != n-1:
        # 今後、現在の株価より高い株価があれば買い
        k = m//A[i]
        m = m - A[i]*k
    elif 0 < k and A[i] == max(A):
        # 全体で最高なら売り
        m = m + A[i]*k
        k = 0
    elif 0 < k and A[i] != min(A[i::]):
        # 今後、現在の株価より安い株価があれば売り
        m = m + A[i]*k
        k = 0
    elif 0 < k and A[i] == max(A[i::])
        # 今後、現在より高い株価がなければ売り
        m = m + A[i]*k
        k = 0
    else:
        pass

print (m)
