N, X = map(int, input().split()) A = list(map(int, input().split())) B = {} for a in A: if a in B: B[a] += 1 else: B[a] = 1 count = 0 for key in B.keys(): x = X - key if x in B: count += B[key] * B[x] print(count)