from collections import defaultdict n,x = map(int,input().split()) a = list(map(int,input().split())) b = defaultdict(int) ans = 0 for i in a: b[i] += 1 for i in a: ans += b[x-i] print(ans)