n, x = map(int, input().split()) a = list(map(int, input().split())) d = {} for i in a: if not i in d: d[i] = 1 else: d[i] += 1 c = 0 for i in d: if x - i in d: c += d[i] * d[x-i] print(c)