import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.PriorityQueue; import java.util.Scanner; import java.util.Set; import java.util.Stack; import java.util.TreeMap; import java.util.TreeSet; import static java.util.Comparator.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Solver solver = new Solver(System.in, out); solver.solve(); out.close(); } } class Solver { Scanner sc; PrintWriter out; public Solver(InputStream in, PrintWriter out) { sc = new Scanner(in); this.out = out; } // ================================================================== int MAX = 100000; int[] CNT = new int[MAX + 10]; public void solve() { int N = Integer.parseInt(sc.next()); int X = Integer.parseInt(sc.next()); int a; for (int i = 0; i < N; i++) { a = Integer.parseInt(sc.next()); CNT[a]++; // out.println("CNT[" + a + "] = " + CNT[a]); } long ans = 0; int wk; for (int i = 0; i <= Math.min(X, MAX); i++) { if(CNT[i] == 0) continue; wk = X - i; // out.println("i = " + i + " wk = " + wk); if(wk <= MAX && CNT[wk] > 0) { ans += ((long)CNT[i] * CNT[wk]); // out.println("ans = " + ans + " CNT[" + i // + "] = " + CNT[i] + " * CNT[" + wk + "] = " + CNT[wk]); } } out.println(ans); } }