#include<iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
string sample;
int row,col;
int realcol,beisucol;
int realrow,beisurow;
long double sum=0;
//int count=0;
//getchar();
//while(getline(cin,sample))
//{
//count++;
cin>>row;cin>>col;
beisucol=col/4;
realcol=col%4;
sum+=(long double)14*beisucol*row;
if(realcol==1)
{
beisurow=row/4;
realrow=row%4;
sum+=(long double)14*beisurow;
switch(realrow)
{
case 1:sum+=(long double)1;
break;
case 2:sum+=(long double)6;
break;
case 3:sum+=(long double)12;
break;
}
}
if(realcol==2)
{
beisurow=row/6;
realrow=row%6;
sum+=(long double)beisurow*42;
switch(realrow)
{
case 1:sum+=(long double)5;
break;
case 2:sum+=(long double)11;
break;
case 3:sum+=(long double)19;
break;
case 4:sum+=(long double)28;
break;
case 5:sum+=(long double)36;
break;
}
}
if(realcol==3)
{
beisurow=row/2;
realrow=row%2;
sum+=(long double)beisurow*22;
if(realrow==1)
{
sum+=(long double)11;
}
}
//cout<<"sample output "<<count<<":"<<endl;
cout<<fixed<<setprecision(0)<<sum<<endl;//注意这个
sum=0;
// getchar();
//}
return 0;
}
#include <string>
#include <iomanip>
using namespace std;
int main()
{
string sample;
int row,col;
int realcol,beisucol;
int realrow,beisurow;
long double sum=0;
//int count=0;
//getchar();
//while(getline(cin,sample))
//{
//count++;
cin>>row;cin>>col;
beisucol=col/4;
realcol=col%4;
sum+=(long double)14*beisucol*row;
if(realcol==1)
{
beisurow=row/4;
realrow=row%4;
sum+=(long double)14*beisurow;
switch(realrow)
{
case 1:sum+=(long double)1;
break;
case 2:sum+=(long double)6;
break;
case 3:sum+=(long double)12;
break;
}
}
if(realcol==2)
{
beisurow=row/6;
realrow=row%6;
sum+=(long double)beisurow*42;
switch(realrow)
{
case 1:sum+=(long double)5;
break;
case 2:sum+=(long double)11;
break;
case 3:sum+=(long double)19;
break;
case 4:sum+=(long double)28;
break;
case 5:sum+=(long double)36;
break;
}
}
if(realcol==3)
{
beisurow=row/2;
realrow=row%2;
sum+=(long double)beisurow*22;
if(realrow==1)
{
sum+=(long double)11;
}
}
//cout<<"sample output "<<count<<":"<<endl;
cout<<fixed<<setprecision(0)<<sum<<endl;//注意这个
sum=0;
// getchar();
//}
return 0;
}