import std; long calc(int x, int[] a) { auto freq = new int[](a.maxElement + 1); foreach (e; a) freq[e]++; long ans = 0; foreach (e; a) { int y = x - e; if (0 <= y && y < freq.length) ans += freq[y]; } return ans; } void main() { int n, x; scan(n, x); auto a = readints; writeln(calc(x, a)); } void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int;