n, x = map(int, input().split()) a = list(map(int, input().split())) cnt = {} for i in a: if i in cnt: cnt[i] += 1 else: cnt[i] = 1 ans = 0 for i in cnt: if x-i in cnt: ans += cnt[i]*cnt[x-i] print(ans)