from bisect import bisect, bisect_left from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def main(): N, X = map(int, input().split()) A = list(map(int, input().split())) A.sort() ans = 0 for ai in A: aj = X - ai i = bisect_left(A, aj) j = bisect(A, aj) ans += j - i print(ans) main()