#!/usr/bin/env python3 import sys def main(): N, X = map(int, input().split()) if X > 2 * 10 ** 5: print(0) return A = list(map(int, input().split())) num = [0] * (10 ** 5 + 1) ans = 0 for aa in A: num[aa] += 1 for aa in A: if X - aa < 0: continue ans += num[X - aa] print(ans) return if __name__ == '__main__': main()