import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int X = scan.nextInt(); int l = 100001; long []a = new long[l]; for(int i = 0; i < N; i++) { a[scan.nextInt()] ++; } scan.close(); long ans = 0; for(int i = 0; i < l; i++) { int res = X - i; if(res >= 0 && res <= 100000) { ans += a[i] * a[res]; } } System.out.println(ans); } }