n,m = map(int,input().split()) a = set(map(int,input().split())) x = 0 for v in a: if m%2==0 and v<=m//2 and v+m//2 in a: x += n-2 print(x)