#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int a,b; cin>>a>>b; if(a>b) swap(a,b); int mi=1e9; for(int i=0;i<=b;i++){ int j=b-i; if(j>a) continue; mi=min(mi,abs(3*b-a-4*i)); } cout<