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 = i; j < N; j++) { if (X == Arys[i] + Arys[j]) { if (i == j) { result += 1; } else { result += 2; } } } } // long end = System.currentTimeMillis(); // System.out.println((end - start) + "ms"); System.out.println(result); } }