eolymp
bolt
Try our new interface for solving problems

SumX

Consider an array of n positive integers a1, a2, ..., an, having values between 1 and 106 and an integer x. Write a program to determine the number of pairs (ai, aj), where 1i < jn and ai + aj = x.

Input

The first line contains the integer n (1n105). The second line contains n integers - the elements of array that can be repeated. On the third line the integer x (1x2 * 106) is given.

Output

Print the calculated number of pairs.

Time limit 1 second
Memory limit 128 MiB
Input example #1
9
5 12 7 10 9 1 2 3 11
13
Output example #1
3
Input example #2
6
1 2 2 2 3 4
5
Output example #2
4