from collections import Counter N, X = map(int, input().split()) a = list(map(int, input().split())) d = Counter(a) ans = 0 for k in d.keys(): ans += d[k] * d[X-k] print(ans)