Diamond Collector (Silver)#10572

Diamond Collector (Silver)

1 second
128 megabytes
Very easy

Bessie the cow, always a fan of shiny objects, has taken up mining diamonds as a hobby in her spare time! She has collected diamonds of varying sizes and wants to arrange some of them in two display cases in the barn.

Since Bessie wants the diamonds in each display case to be relatively similar in size, she decides that she will not place two diamonds in the same case if their sizes differ by more than . Two diamonds may be displayed together in the same case if their sizes differ by exactly .

Given , please help Bessie determine the maximum total number of diamonds she can display in the two cases.

Input

The first line contains two integers n~(n \le 50000) and k~(0 \le k \le 10^9).

The next lines each contain an integer representing the size of one of the diamonds. All diamond sizes are positive and do not exceed 10^9.

Output

Print one integer representing the maximum total number of diamonds Bessie can display in the two cases.

Examples

Example 1

Loading
Loading