from collections import defaultdict n, x = map(int, input().split()) a = list(map(int, input().split())) cnt = defaultdict(int) for k in a: cnt[k] += 1 ans = 0 for k, v in cnt.items(): if k > x: continue ans += v * cnt[x - k] print(ans)