#include <bits/stdc++.h> 
#define ll long long 
#define int long long 
#define Sayan ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) 
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) 
#define all(a) a.begin() , a.end() 
#define Int(a,x) a+1 , a+1+x 
#define sz() size() 
#define F first 
#define S second 
#define pb push_back 
#define yes cout << "YES\n" 
#define no cout << "NO\n" 
#define pii pair<ll,ll> 
using namespace std ; 
  
const ll N = 3e5+5; 
const ll INF = 1e18; 
const ll mod = 1e9+7; 
  
signed main () { 
    Sayan; 
    int tt=1; 
    //  cin>>tt; 
    while(tt--){ 
     ll n,m; 
     cin>>n>>m; 
     ll sum=n*m; 
     ll otv=(min(n,m)+1)*sum; 
     if(max(n,m)%2==1){ 
      otv+=(max(n,m)-1)*min(n,m); 
  } 
  cout<<otv<<"\n"; 
    } 
}
