from bisect import bisect_left, bisect_right n, x = map(int, input().split()) a = sorted(list(map(int, input().split()))) ans = 0 for i in a: ans += bisect_right(a, x - i) - bisect_left(a, x - i) print(ans)