#include #define TEN5 100000 typedef long long ll; ll c[TEN5+1]; int main(){ ll N,X,a; ll cnt = 0; scanf("%lld",&N); scanf("%lld",&X); for(int i = 0; i <= TEN5 ; i++) c[i] = 0; for(int i = 0; i < N; i++){ scanf("%lld",&a); c[a] += 1; } for(int i = 0; i <= TEN5 ; i++){ if(0 <= X-i && X-i <= TEN5) cnt += c[i]*c[X-i]; } printf("%lld\n",cnt); }