from collections import Counter def main(): n, x = map(int, input().split()) arr = list(map(int, input().split())) c = Counter(arr) ans = sum([c[x - a] for a in arr]) print(ans) if __name__ == "__main__": main()