#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); const int MAX_A = 100000; int N, X; cin >> N >> X; vector As(N, 0); vector freq(MAX_A + 1, 0); for (int i = 0; i < N; ++i){ cin >> As[i]; ++freq[As[i]]; } long long count = 0; for (auto a : As){ int b = X - a; if (b >= 0 and b <= MAX_A){ count += freq[b]; } } cout << count << endl; return 0; }