#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#include <random>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;



int main() {
  int a,b;
  scanf("%d%d",&a,&b);
  if (a == b) {
    cout<<0<<endl;
    return 0;
  }
  if (abs(a) == abs(b)) {
    cout<<1<<endl;
    return 0;
  }
  if (abs(a) < abs(b)) {
    int ans = abs(b)-abs(a);
    if (a < 0) ans++;
    if (b < 0) ans++;
    cout<<ans<<endl;
    return 0;
  } else {
    int ans = abs(a)-abs(b);
    if (a > 0) ans++;
    if (b > 0) ans++;
    cout<<ans<<endl;
    return 0;
  }
  return 0;
}






























#include <bits/stdc++.h>
#define mod 998244353
using namespace std;
int fac[1000005],inv[1000005],n,m;
inline int qpow(int a,int b)
{int tp=a,res=1;
while (b)
{if (b&1) res=1ll*res*tp%mod;
tp=1ll*tp*tp%mod;b>>=1;
}
return res;
}
inline int cal(int a,int b)
{return 1ll*(1ll*fac[a+b]*inv[a]%mod)*inv[b]%mod;}
int main (){
	int i,ans;
	scanf ("%d%d",&n,&m);
	if (n>m) swap(n,m);
	for (fac[0]=1,i=1;i<=n+m;i++)fac[i]=1ll*fac[i-1]*i%mod;
	for (inv[n+m]=qpow(fac[n+m],mod-2),i=n+m-1;i>=0;i--)inv[i]=1ll*inv[i+1]*(i+1)%mod;
	int tot=cal(n,m),now=0;
	for (i=1;i<=n;i++)
	{now+=1ll*cal(i,i)*cal(n-i,m-i)%mod;
	if (now>=mod) now-=mod;
	}
	now=1ll*now*qpow(tot,mod-2)%mod;
	now=1ll*now*qpow(2,mod-2)%mod;
	now=(now+m>=mod?now+m-mod:now+m);
	printf ("%d\n",now);
	return 0;
}