s = list(map(int,input().split())) ss = list(map(int,input().split())) sss = {} ans = 0 for i in ss: if i not in sss: sss[i] = 1 else: sss[i] += 1 for a,b in sss.items(): if s[1] - a in sss: ans += b * sss[s[1]-a] print(ans)