#include #include #include #include long long int min(long long int a,long long int b) { if(a>b) return b; else return a; } long long int max(long long int a,long long int b) { if(a>b) return a; else return b; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long int n,m,c,d,ans; scanf("%lld%lld",&n,&m); c=min(n,m); d=max(n,m); ans=(c-1)+c*(d-1); printf("%lld\n",ans); return 0; }