Average Voodoo Doll Price

Count the contiguous runs of days whose average doll price is at least P.

Medium6Prefix sumDivide and conquerSortingNo attempts yetTime limit2sMemory limit64 MB

Problem

Mirko has been buying voodoo dolls. He wants to buy as cheaply as possible, so he writes down the price of a doll every day. His price list holds the doll prices of the last NN days, and the price aia_i is the price of a doll ii days ago.

Mirko thinks the average price over a run of consecutive days is connected to the price on the next day. While testing that hunch he ran into another question. For a given PP, how many runs of consecutive days within the last NN days had an average doll price greater than or equal to PP?

Two runs of consecutive days count as different when they start at different positions or end at different positions.

Input

The first line contains the sequence length NN. (1N10000001 \le N \le 1\,000\,000)

The second line contains the NN prices aia_i. (0ai10000000000 \le a_i \le 1\,000\,000\,000)

The third line contains an integer PP. (0P10000000000 \le P \le 1\,000\,000\,000)

Output

Print on the first line the number of consecutive runs whose average price is greater than or equal to PP.

Hint

In the first example the only run whose average is at least 3 is {3}.

In the second example the runs whose average is at least 2 are {1, 3}, {1, 3, 2}, {3}, {3, 2}, {2}.