There are

cities and

car styles in NIO Kingdom. According to the investigations, for the

-th city, cars of style

are the most popular.
Now there will be a car show in NIO Kingdom, and the person in charge wants to choose an integer interval
)
and let the cities whose indices are in this interval hold the show jointly. And to manifest the variety of the cars, every style should occur at least once among the most popular styles in the host cities. Determine the number of integer intervals satisfying the constraint mentioned before.