a, b = map(int,input().split()) xs = map(int,input().split()) cnt = 0 for i in range(len(xs)): for j in range(len(xs)): if xs[i] + xs[j] == b: cnt += 1 print(cnt)