#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; ll x; cin >> n >> x; vector a(n); rep(i, n) cin >> a[i]; map mp; rep(i, n){ if(mp.count(a[i]) == 0) mp[a[i]] = 0; mp[a[i]]++; } ll ans = 0; rep(i, n){ if(mp.count(x - a[i]) > 0){ ans += mp[x - a[i]]; } } cout << ans << endl; }