import math import copy n, x = [ int(v) for v in input().split(" ") ] number_list = [ int(v) for v in input().split(" ") ] def add(a,b): return a + b sumlist = [ list(map(add,number_list,[number_list[i]]*n)) for i in range(n) ] print( sum( [ sumlist[i].count(x) for i in range(n) ] ) )