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