Maximum#7257

Maximum

0.2 seconds
64 megabytes
Very easy

Let's define a fragment of a numerical sequence as any non-empty contiguous subsequence of that sequence. For instance, in the sequence of numbers , the fragments include the entire sequence , the two-element subsequences and (but not the subsequence ), as well as the single-element subsequences , , and .

Task

Write a program that, given a sequence of numbers and a value , calculates how many fragments of the sequence have a maximum value equal to . Note that fragments with the same numbers but in different positions in the sequence are considered distinct.

Input

The first line of the input contains two natural numbers: (2 \le N \le 10^5) — the length of the sequence — and (1 \le M \le 10^9). The second line contains a sequence of natural numbers, each not exceeding 10^9.

Output

The output should be a single number — the count of fragments in the sequence whose largest number is exactly .

Examples

Example 1

Loading
Loading

Scoring

The test set is divided into blocks, with the following conditions:

  1. points: 2 \le N \le 100

  2. points: 100 < N \le 1000

  3. points: 1000 < N \le 10^5