import java.util.*; public class Main { public static void main (String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); TreeMap map = new TreeMap<>(); for (int i = 0; i < n; i++) { int a = sc.nextInt(); if (map.containsKey(a)) { map.put(a, map.get(a) + 1); } else { map.put(a, 1L); } } long total = 0; for (int y : map.keySet()) { if (y > x) { break; } if (map.containsKey(x - y)) { total += map.get(y) * map.get(x - y); } } System.out.println(total); } }