import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(),x=sc.nextInt(),a[]=new int[100000],t[]=new int[100001],i; long s=0; for(i=0;i=0&&100000>=x-a[i]) s+=t[x-a[i]]; System.out.print(s); } }