n,x=map(int,input().split()) a=list(map(int,input().split())) c=0 for i in range(0,n): c+=a.count(x-i) print(c)