import java.util.Scanner; // import java.util.List; // import java.util.ArrayList; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); // List a = new ArrayList(); int count = 0, N, X; N = sc.nextInt(); X = sc.nextInt(); int[] a = new int[N]; for (int i = 0; i < N; i++) { a[i] = sc.nextInt(); } for (Integer i : a) { for (Integer j: a) { if (i+j == X) { count++; } } } System.out.println(count); } }