#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int MOD = 1000000007;
const int INF = LLONG_MAX/2;
const int MAXN = 100000;
int primes[1000000];
void seive(){
fill(primes, primes + 1000000, 1);
primes[0] = primes[1] = 0;
for(int i = 2 ; i*i < 1000000 ; i++){
if(primes[i]){
for(int j = i*i ; j < 1000000 ; j += i){
primes[j] = 0;
}
}
}
}
bool isPrime(int n){
if(n <= 1) return false;
for(int i = 2 ; i*i <= n ; i++){
if(n % i == 0) return false;
}
return true;
}
int gcd(int a, int b){
if(a == 0) return b;
return gcd(b % a, a);
}
int power(int a, int b) {
int res = 1;
a %= MOD;
while (b > 0) {
if (b & 1) res = res * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return res;
}
// nCr % MOD for n < MOD
int nCrModP(int n, int r) {
if (r > n) return 0;
if (r == 0 || r == n) return 1;
int numerator = 1, denominator = 1;
for (int i = 0; i < r; i++) {
numerator = (numerator * (n - i)) % MOD;
denominator = (denominator * (i + 1)) % MOD;
}
return (numerator * power(denominator, MOD - 2)) % MOD;
}
// Lucas's Theorem
int lucas(int n, int r) {
if (r == 0) return 1;
return (lucas(n / MOD, r / MOD) * nCrModP(n % MOD, r % MOD)) % MOD;
}
void solve() {
int n,target;
cin>>n>>target;
int A[n];
for(int i = 0 ; i<n ; i++){
cin>>A[i];
}
if(target%2!=0){
cout<<0<<endl;
}
else{
int totalcnt = 0;
int c1 = 0,c2=0;
for(int i = 0 ; i<n ; i++){
if(A[i]>=0 && A[i]==(target/2)){
c1++;
}
}
for(int i = 0 ; i<n ; i++){
if(A[i]>=0 && A[i]<(target/2)){
c2++;
}
}
totalcnt += (c1*c2);
totalcnt += (c1*(c1-1))/2;
c1 = 0,c2=0;
for(int i = 0 ; i<n ; i++){
if(A[i]<0 && A[i]==(-(target/2))){
c1++;
}
}
for(int i = 0 ; i<n ; i++){
if(A[i]<0 && (A[i]>(-(target/2)))){
c2++;
}
}
totalcnt += (c1*c2);
totalcnt += (c1*(c1-1))/2;
c1 = 0 ,c2 =0;
for(int i = 0 ; i<n ; i++){
if(A[i]>=0 && A[i]==(target/2)){
c1++;
}
}
for(int i = 0 ; i<n ; i++){
if(A[i]<0 && abs(A[i])<=(target/2)){
c2++;
}
}
totalcnt += (c1*c2);
c1 = 0,c2=0;
for(int i = 0 ; i<n ; i++){
if(A[i]<0 && A[i]==(-(target/2))){
c1++;
}
}
for(int i = 0 ; i<n ; i++){
if(A[i]>=0 && abs(A[i])<(target/2)){
c2++;
}
}
totalcnt += (c1*c2);
cout<<totalcnt<<endl;
}
}
signed main(){
ios::sync_with_stdio(false); cin.tie(NULL);
//int t;
//cin >> t;
//while(t--){
solve();
//}
return 0;
}