import sys readline=sys.stdin.readline from collections import Counter N,X=map(int,readline().split()) A=list(map(int,readline().split())) C=Counter(A) ans=sum(C[X-a] for a in A) print(ans)