You are given an integer sequence of length N, a = {a_1, a_2, …, a_N}, and an integer K.

a has N(N+1)/2 non-empty contiguous subsequences, {a_l, a_{l+1}, …, a_r} (1 ≤ l ≤ r ≤ N). Among them, how many have an arithmetic mean that is greater than or equal to K?

Constraints

* All input values are integers.
* 1 ≤ N ≤ 2 \times 10^5
* 1 ≤ K ≤ 10^9
* 1 ≤ a_i ≤ 10^9

Input

Input is given from Standard Input in the following format:


N K
a_1
a_2
:
a_N


Output

Print the number of the non-empty contiguous subsequences with an arithmetic mean that is greater than or equal to K.

Examples

Input

3 6
7
5
7


Output

5


Input

1 2
1


Output

0


Input

7 26
10
20
30
40
30
20
10


Output

13
import java.util.*;

class Main {
    static long[] sum;
    static int n;
    static long tot = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int K = sc.nextInt();
        sum = new long[n+1];
        for(int i=1;i<=n;i++) {
            sum[i] = sum[i-1]+sc.nextInt()-K;
        }
        // kind of like reverse number problem. Here we want to count how many (i,k) s.t. 0<=i<k<=n&&sum[i]<=sum[k];
        merge(0,n);
        System.out.println(tot);
    }
    static void merge(int left, int right){
        if(left>=right) return;
        int mid = (left+right)/2;
        merge(left,mid);
        merge(mid+1,right);
        int i=left,j=mid+1,k=0;
        long[] temp = new long[right-left+1];
        while(i<=mid&&j<=right){
            if(sum[i]<=sum[j]) {
                tot += mid-i+1;
                temp[k++] = sum[j++];
            }
            else temp[k++] = sum[i++];
        }
        while(i<=mid) temp[k++] = sum[i++];
        while(j<=right) temp[k++] = sum[j++];
        for(int m=0;m<temp.length;m++) sum[left+m] = temp[m];
    }
}
