import bisect n,x=map(int,input().split()) a=sorted(list(map(int,input().split()))) ans=0 for i in range(n): v=x-a[i] if v<0: pass else: ans+=bisect.bisect_right(a,v)-bisect.bisect_left(a,v) print(ans)