#include using namespace std; using ll = long long; int main(){ 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(int i = 0; i < n; i++){ int num = x - a[i]; if(num < 0) break; ans += upper_bound(a.begin(), a.end(), num) - lower_bound(a.begin(), a.end(), num); } cout << ans << endl; return 0; }