import collections N,X = map(int,input().split()) lsa = list(map(int,input().split())) cnt = collections.Counter(lsa) ans = 0 for i in range(N): ans += cnt[X-lsa[i]] print(ans)