from collections import Counter n, x = map(int, input().split()) counter = Counter(list(map(int, input().split()))) ans = 0 vals = set(counter.keys()) for val, cnt in counter.items(): if x - val in vals: ans += cnt * counter[x -val] print(ans)