#include using namespace std; typedef long long ll; int main() { int n, x; cin >> n >> x; map m; for (int i = 0; i < n; ++i) { ll a; cin >> a; m[a]++; } ll ans = 0; for (auto e: m) { if (e.first > x) continue; if (x - e.first == e.first) { ans += m[e.first] * m[e.first]; } else { ans += m[e.first] * m[x - e.first]; } } cout << ans << endl; return 0; }