#include using namespace std; typedef long long ll; signed main(){ ios::sync_with_stdio(false); cin.tie(0); ll n,x; cin>>n>>x; ll a[111111]={}; for(int i=0;i>b; a[b]++; } ll ans=0; for(int i=0;i<=x/2;i++){ if(x-i>101010) continue; if(i==x/2 && i*2==x){ ans+= a[i]*a[i]; } else ans += 2*a[i]*a[x-i]; } cout<