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]; an = new int[n]; int ans = 0; for (int i = 0; i < n; i++) { int a = sc.nextInt(); an[i] = a; } if (an[0] + an[0] == x) { ans = -1; } for (int i = 0; i < n; i++) { for (int i2 = 0; i2 < n; i2++) { if (an[i] + an[i2] == x) { ans++; } } } System.out.println(ans); } }