#include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = int64_t; using namespace std; template constexpr T INF = ::numeric_limits::max()/32*15+208; int main() { map m; int n, x; cin >> n >> x; ll ans = 0; vector v(n); for (auto &&i : v) scanf("%d", &i), m[i]++; for (int i = 0; i < n; ++i) ans += m[x-v[i]]; cout << ans << "\n"; return 0; }