import java.util.Scanner; public class No_723 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int X = sc.nextInt(); int count = 0; int mid = X / 2; int[] aa = new int[N]; for (int i = 0; i < N; i++) { aa[i] = sc.nextInt(); } for (int i = 0; i < N; i++) { for (int y = i + 1; y < N; y++) { if (aa[i] + aa[y] == X) { count++; } } } count *= 2; for (int i = 0; i < N; i++) if (mid == aa[i] && X % 2 == 0) count++; System.out.println(count); } }