import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); int[] an = new int[n]; int sa; int ans = 0; for (int i = 0; i < n; i++) { int a = sc.nextInt(); an[i] = a; } for (int i = 0; i < n; i++) { sa = x - an[i]; if (sa <= x) { for (int i2 = 0; i2 < n; i2++) { if (sa == an[i2]) { ans++; } } } } System.out.println(ans); } }