#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; int main(){ ll n,x; cin>>n>>x; map m; ll y; rep(i,n){ cin>>y; m[y]++; } ll sum=0; for(auto t:m){ if(t.first>2*x) break; else if(t.first==2*x) sum+=t.second*(t.second)/2; else sum+=t.second*m[x-t.first]; } cout<