#include using namespace std; #define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define P(a,n) for(int i=a;i<=n;i++) cout<>x; #define c2(x,y) cin>>x>>y; #define c3(x,y,z) cin>>x>>y>>z; #define p2(x,y) cout< VI; typedef long double ld; typedef long long ll; typedef pair pii; typedef pair pll; typedef vector VII; typedef vector VL; typedef vector VLL; ll tpp = 9e18; int tp = 1e9; ll n,m; int main() { _ c2(n,m); if(n==1 or m==1) { co(max(n,m)-1); r0; } ll res = (n-1) + (m-1)*(n); ll res2 = (m-1) + (n-1)*(m); co(min(res,res2)); r0; }