def load_to_millionar():
    days = int(input())
    prices = tuple(map(int, input().split()))

    if max(prices) == prices[0]:
        print(1000)
        return

    k = 1000 // prices[0]
    total = 1000 - prices[0] * k
    maxp = prices[0]

    for d in range(1, days):

        # 売る
        if prices[d] > maxp or d == days - 1:
            total += k * prices[d]
            k = 0
            maxp = prices[d]

        # 買う
        elif max(prices[d:]) > maxp > prices[d]:
            buy = total // prices[d]
            total -= buy * prices[d]
            k += buy

    print(total)


if __name__ == '__main__':
    load_to_millionar()
