N, X = map(int, input().split()) a = [map(int, input().split())] c = 0 for i1 in a: for i2 in a: c += [0, 1][(i1 + i2) == X] print(c)