Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya are wondering in many ways he can choose three distinct points the distance between Of them doesn ' t exceed D.
Note This order of the points inside the group of three chosen points doesn ' t matter.
Input
The contains two integers:n and D (1≤n≤105; 1≤d≤109). The next line contains n integers x1,x2,..., xn their absolute value doesn ' t exceed 109-the x-coordinates of the points That Petya has got.
It is guaranteed this coordinates of the points in the input strictly increase.
Output
Print a single integer-the number of groups of three points, where the distance, between two farthest points ' t doesn Ed D.
Please don't use the%lld specifier to read or write 64-bit integers inс++. It is preferred to use the CIN, cout streams or the%i64dspecifier.
Sample Input
Input
4 3
1 2 3 4
Output
4
Input
4 2
-3-2-1 0
Output
2
Input
5 19
1 10 20 30 50
Output
1
Hint
In the three points meets we conditions of the any group.
In the seconds sample only 2 groups of three points meet we conditions: { -3,-2,-1} and {-2,-1, 0}.
In the third sample only one group does: {1, 10, 20}.