#include using namespace std; map,long>mp; long getAns(long m, long n) { long max1=max(m,n),min1=min(m,n); pair p1; p1.first=max1; p1.second=min1; if(mp[p1]!=0) return mp[p1]; if(min1==1) { mp[p1]=max1-1; return max1-1; } if(max1%2==0) { mp[p1]=1+2*getAns(max1/2,min1); return mp[p1]; } mp[p1]=1+getAns(max1/2,min1)+getAns(max1-max1/2,min1); return mp[p1]; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long N,M; cin>>N>>M; cout<