from bisect import bisect_right, bisect_left

n, x = map(int, input().split())
alst = list(map(int, input().split()))
alst.sort()

ans = 0
for num in alst:
    tmp = x - num
    if num == tmp:
        ans += bisect_right(alst, tmp) - bisect_left(alst, tmp)
    else:
        ans += bisect_right(alst, tmp) - bisect_left(alst, tmp)
print(ans)