#include<bits/stdc++.h>
using namespace std;
int n,k;
long long s;
void solve(){
	cin>>n>>k;
	if(k<0)k=-k;
	for(int i=1;i<=2*n-k;++i){
		if(n<k+i){
			if(n>i){
				s+=1ll*(2*n-k-i)*i;
			}
			else{
				s+=1ll*(2*n-k-i)*(2*n-i);
			}
		}
		else{
			s+=1ll*(k+i)*(i);
		}
	}
	cout<<s<<"\n";
}
int main(){
	solve();
	return 0;
}
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <cassert>
#include <vector>
#include <random>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>

//#include <atcoder/all>

#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=998244353;
const int dx[8]={-1,0,1,0,1,1,-1,-1},dy[8]={0,1,0,-1,1,-1,1,-1};

//using namespace atcoder;

ll Pow(ll n,ll p){
	ll r=1;
	for(;p>0;p>>=1){
		if(p&1) r=(r*n)%mod;
		n=(n*n)%mod;
	}
	return r;
}

const int M=1000005;
ll F[M];

void Init(){
	F[0]=1;
	for(int i=1;i<M;i++) F[i]=F[i-1]*i%mod;
}

ll Div(ll n,ll m){
	return n*Pow(m,mod-2)%mod;
}

ll nCk(ll n,ll k){
	return Div(F[n],F[n-k]*F[k]%mod);
}

ll dp[21][5005],N;

ll Rec(int i,int n){
	if(n==0) return 1;
	if(i<0) return 0;
	if(dp[i][n]>=0) return dp[i][n];
	ll res=0,x=1<<i;
	for(int j=0;j*x<=n&&j<=N;j+=2){
		(res+=nCk(N,j)*Rec(i-1,n-j*x))%=mod;
	}
	return dp[i][n]=res;
}

int m;

int main(){
	for(int i=0;i<21;i++) for(int j=0;j<5005;j++) dp[i][j]=-1;
	Init();
	cin>>N>>m;
	cout<<Rec(20,m)<<endl;
}










