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