#include using namespace std; #define REP(i,a) for(int i = 0; i < (a); i++) #define ALL(a) (a).begin(),(a).end() typedef long long ll; typedef pair P; const int INF = 1e9; const int MOD = 1e9 + 7; signed main(){ int n; ll x; cin >> n >> x; int a[n]; REP(i,n){ cin >> a[i]; } sort(a, a + n); ll ans = 0; REP(i,n){ ans += upper_bound(a, a + n, x - a[i]) - lower_bound(a, a + n, x - a[i]); } cout << ans << endl; }