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 c_in, count = 0, N, X; N = sc.nextInt(); X = sc.nextInt(); for (int i = 1; i <= N; i++) { a.add(sc.nextInt()); } for (Integer i : a) { for (Integer j: a) { if (i+j == X) { count++; } } } System.out.println(count); } }