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