N,X = list(map(int,input().split())) a = list(map(int,input().split())) C = 10 ** 5 dat = [0] * (C+1) for i in a: dat[i] += 1 count = 0 for i in range(C+1): if 0 <= X - i <= C: count += dat[i] * dat[X-i] print(count)