#include using namespace std; using ll = long long; int main(void) { int N, X; cin >> N >> X; vector a(N); for(int i = 0; i < N; ++i) cin >> a[i]; sort(a.begin(), a.end()); ll ans = 0; for(auto x : a) ans += (upper_bound(a.begin(), a.end(), X - x) - lower_bound(a.begin(), a.end(), X - x)); cout << ans << endl; return 0; }