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

    money = 1000
    trading = []
    buy = True

    for i in range(1, len(A)):
        if buy:
            if A[i] <= A[i-1]:
                continue
            else:
                trading.append(A[i-1])
                if i == len(A)-1:
                    trading.append(A[i])
                buy = False
        else:
            if A[i] >= A[i-1]:
                continue
            else:
                trading.append(A[i-1])
                buy = True
    
    if len(trading) % 2 == 1:
        trading.pop(-1)
    
    stock = 0
    
    for i in range(len(trading)):
        if i % 2 == 0:
            stock = money // trading[i]
            money -= stock * trading[i]
        else:
            money += stock * trading[i]
            stock = 0

    print(money)


if __name__ == '__main__':
    main()