import java.util.Scanner; public class Question723 { public static void main(String[] args) { //long start = System.currentTimeMillis(); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int X = sc.nextInt(); int a[] = new int[N]; int t[] = new int[N + 1]; int result = 0; for (int i = 0; i < N; i++) { a[i] = sc.nextInt(); t[a[i]]++; } for (int i = 0; i < N; i++) { if (X - a[i] >= 0 && 100000 >= X - a[i]) { result += t[X - a[i]]; } } // long end = System.currentTimeMillis(); // System.out.println((end - start) + "ms"); System.out.println(result); } }