N, X = map(int, input().split()) A = list(map(int, input().split())) count = 0 for ai in A: for aj in A: if ai + aj == X: count += 1 print(count)