using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var line = Console.ReadLine().Split(' '); var n = int.Parse(line[0]); var x = int.Parse(line[1]); var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); Array.Sort(a); var sum = 0; foreach(var m in a) { sum += a.Where(value => value + m == x).Count(); } Console.WriteLine(sum); } } }