import bisect import sys input = sys.stdin.readline def main(): N, X = map(int, input().split()) A = list(map(int, input().split())) A.sort() ans = 0 for i in range(N): r = bisect.bisect_right(A, X-A[i]) l = bisect.bisect_left(A, X-A[i]) ans += r - l print(ans) if __name__ == '__main__': main()