#include using namespace std; const int MAXN = 100000; long long A[ MAXN + 1 ]; int main() { int i; int a; int N; int X; int H; long long iCnt; ios::sync_with_stdio( false ); cin.tie( 0 ); cin >> N; cin >> X; if( X > MAXN * 2 ) { cout << 0 << endl; return 0; } for( i = 0; i < N; i++ ) { cin >> a; if( a > X ) continue; A[ a ]++; } H = X / 2; iCnt = 0; for( i = 0; i <= H; i++ ) { iCnt += 2 * A[ i ] * A[ X - i ]; } if( 2 * H == X ) iCnt -= A[ H ] * A[ H ]; cout << iCnt << endl; return 0; }