import collections _, X = map(int, input().split()) C = collections.Counter(map(int, input().split())) s = 0 for c in C: s += C[X-c] * C[c] print(s)