n, x = map(int, input().split()) l = list(map(int, input().split())) ans = 0 for i in l: for j in l: if i + j == x: ans += 1 print(ans)