#include #include #include #define TEN5 100000 typedef long long ll; int c[TEN5+1]; int main(){ ll N,X,a; int 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(X-i <= TEN5) cnt += c[i]*c[X-i]; } printf("%d\n",cnt); }