#include <bits/stdc++.h>using namespace std ;int main() { int n,m,x,sum,b,ans; while(cin>>n>>m){ x=n*2; sum=(2*x+1)*m+x; b=n*m; ans=sum-b; cout<<ans<<endl; x=0; sum=0; b=0; ans=0; }}