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[] aa = new int[N]; for (int i = 0; i < N; i++) aa[i] = sc.nextInt(); int count = 0; boolean b = false; for (int i = 0; i < N; i++) { for (int y = 0; y < N; y++) { if (aa[i] + aa[y] == X) { count++; } else if (aa[i] + aa[y] == X && X % 2 == 0 && X > 3 && i == y) b = true; } } if (b) count--; System.out.println(count); } }