n,x = map(int,input().split()) num = list(map(int,input().split())) a = {} k = 0 for i in num : if i in a : a[i] += 1 else : a[i] = 1 for j in a : if x - j in a : k += a[j]*a[x-j] print(k)