n, x = [ int(v) for v in input().split() ] num = sorted([ int(v) for v in input().split() ]) s = 0 for i in range(n): a = (bisect.bisect_left(num,x-num[i])) b = (bisect.bisect_right(num,x-num[i])) s += b - a print(s)