#include #define print(x) std::cout << x << std::endl using namespace std; typedef vector VI; typedef vector VS; //container util #define SORT(c) sort((c).begin(),(c).end()) //repetition #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main(void){ int N,X; cin >> N >> X; VI a(N,0); REP(i,N) cin >> a[i]; int ans = 0; REP(i,N){ REP(j,N){ if(a[j] > X || a[i] > X) j = N; if(a[i]+a[j] == X) ans++; } } print(ans); return 0; }