import itertools as it n,x=map(int,input().split()) l=list(map(int,input().split())) c=0 for y in it.product(l,repeat=2): if sum(y)==x: c+=1 print(c)