#include<iostream>
using namespace std;
{
int tmp=0;
if(a<b){
tmp=a;
a=b;
b=tmp;
tmp=0;
}
while(b) {if(b&0x1)
tmp+=a;
a<<=1;b>>=1;
}
return tmp;
}
int main(){
int a,b;
while(cin>>a>>b)
cout<<multi(a,b)<<endl;
return 1;
}
#include<iostream>
using namespace std;
if(a<b){
tmp=a;
a=b;
b=tmp;
tmp=0;
}
while(b) {if(b&0x1)
tmp+=a;
a<<=1;}
int main(){
int a,b;
while(cin>>a>>b)
cout<<multi(a,b)<<endl;
return 1;
}