def function(N, A):
    money = 1000
    kabu = 0
    for i in range(N-1):
        if (i == 0) & (A[0] < A[1]):
            kabu = int(1000/A[0])
            money = 1000-kabu*A[0]
        elif (A[i-1] >= A[i]) & (A[i] < A[i+1]):
            kabu = int(money/A[i])
            money = money-kabu*A[i]
        elif (A[i-1] <= A[i]) & (A[i] > A[i+1]):
            money = money+kabu*A[i]
            kabu = 0
    print(money+kabu*A[N-1])


if __name__ == '__main__':
    N = int(input())
    A = input().split()
    A = [int(a) for a in A]
    function(N, A)
