#include #define INF 1000000007 #define LINF 1000000000000000007 using namespace std; typedef long long ll; typedef pair P; int n, x, a[100000], d[100001] = {0}; int main(){ cin >> n >> x; for(int i = 0; i < n; i++){ cin >> a[i]; d[a[i]]++; } ll cnt = 0; if(x > 200000) cout << 0 << endl; else{ for(int i = 0; i <= x; i++){ cnt += d[i] * d[x-i]; } cnt -= d[x/2]; cout << cnt << endl; } return 0; }