#include #include #include #include using ll = long long; using namespace std; int main() { int n, x, a, ans = 0; cin >> n >> x; multiset v; for (int i = 0; i < n; ++i) { cin >> a; v.insert(a); } for (auto &k : v) { if(v.count(x-k)) ans+=v.count(x-k); } cout << ans << "\n"; return 0; }