def calc(X, A): B = [0] * 101010 for ia in A: B[ia] += 1 c = 0 for i1 in A: if X - i1 >= 0 and X - i1 <= 100000: c += B[X - i1] return c if __name__ == '__main__': N, X = map(int, input().split()) a = list(map(int, input().split())) print(calc(X, a))