def laod_to_mill():
    '''
    株の売買 D
    '''
    days = int(input())
    prices = tuple(map(int, input().split()))

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

    total = 1000
    ks = 0

    for d in range(days):
        if d == days - 1:
            total += ks * prices[d]
            break

        total += ks * prices[d]
        ks = 0

        if prices[d] < prices[d + 1]:
            ks = total // prices[d]
            total %= prices[d]

    print(total)


def main():
    laod_to_mill()


if __name__ == '__main__':
    main()
