#include #include #include #include #include using namespace std; int main() { long int n,m,res,first,rest; cin>>n>>m; if(n>m) { first=m-1; rest=(n-1)*m; } else if(n==m) { first=n-1; rest=(m-1)*n; } else{ first=n-1; rest=n*(m-1); } res=rest+first; cout<