N, X = map(int, input().split()) a = list(map(int, input().split())) b = {} for ai in a: if ai not in b: b[ai] = 1 else: b[ai] += 1 ans = 0 for k in b: if X - k in b: ans += b[k] * b[X - k] print(ans)