#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int INF = 1e15; int d[100010]; signed main(){ int n, x; cin >> n >> x; vector a(n); rep(i, 0, n){ cin >> a[i]; d[a[i]]++; } int ans = 0; rep(i, 0, n){ int tmp = x - a[i]; if(0 <= tmp && tmp <= 100000){ ans += d[tmp]; } } cout << ans << endl; }