import java.util.Scanner; public class Question723 { public static void main(String[] args) { //long start = System.currentTimeMillis(); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int X = sc.nextInt(); int result = 0; int[] Arys = new int[N]; for (int i = 0; i < N; i++) { Arys[i] = sc.nextInt(); } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (X == Arys[i] + Arys[j]) { result++; } } } // long end = System.currentTimeMillis(); // System.out.println((end - start) + "ms"); System.out.println(result); } }