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