from collections import Counter n, x = map(int, input().split()) alst = list(map(int, input().split())) dic = Counter(alst) ans = 0 for k in dic: ans += dic[k] * dic[x - k] print(ans)