#include using namespace std; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n, x; cin >> n >> x; vector A(n); map mp; for(int i = 0; i < n; i++){ cin >> A[i]; mp[A[i]]++; } if(x == 0){ cout << (long long)n * (long long)n << endl; return 0; } sort(A.begin(), A.end()); int ans = 0; for(int i = 0; i < n; i++){ int r = x - A[i]; ans += mp[r]; } cout << ans << endl; return 0; }