eolymp
bolt
Try our new interface for solving problems
Problems

Bomb disposal

Bomb disposal

In the city of Night City, a lot of terrible events are happening. Right now, Vi is risking his life to defuse a bomb in the heart of the Watson region.

After quickly examining the bomb, Vi noticed that it had exactly n buttons, each with a positive integer written on it. Any button can be in active and inactive state, the state is switched by pressing, which takes exactly one second. Initially, all buttons are in the active state.

From a trusted informant, Vi knows that the bomb will explode if and only if at the end of the countdown there are two buttons on it in an active state with the sum of the numbers on them exactly k. Of course, he is interested in the minimum time in which the bomb can be defused.

Vi damaged his brain implant for fast calculations on the last mission, and now he needs your help to find out what is the minimum number of button presses that he has to make so that the bomb does not explode.

Input

The first line contains two integers n and k (1n105, 1k109).

The next line contains n numbers ai (1ai109) which are written on the buttons.

Output

Print a single integer - the minimum number of button presses needed to defuse the bomb.

Time limit 1 second
Memory limit 256 MiB
Input example #1
5 100
77 23 45 54 22
Output example #1
1
Input example #2
7 7
4 3 4 8 4 3 4
Output example #2
2
Source 2021 ITMO University, First personal olympiad, January 31, Problem А