def mainProc(x, lst): lst.sort() ct = 0 for i in lst : for j in lst : if i + j == x : ct += 1 elif i + j > x : break print(ct) if __name__ == '__main__': n, x = map(int,input().split()) lst = [int(i) for i in input().split()] mainProc(x, lst)