#include #include #include #include #include #include #include int main(){ unsigned long long int n; unsigned long long int m; scanf("%llu %llu",&n,&m); unsigned long long int ans=0; if(n>=m) { ans = (n-1) + n*(m-1); } else { ans = (m-1) + m*(n-1); } printf("%llu\n",ans); return 0; }