from collections import defaultdict def main(): N, X = map(int, input().split()) A = list(map(int, input().split())) d = defaultdict(int) for a in A: d[a] += 1 ans = 0 for a in A: tmp = X - a ans += d[tmp] print(ans) if __name__ == "__main__": main()