#include #include #include #include int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long int n,m,resh=0,resv=0,sum=0; scanf("%lld %lld",&n,&m); if(n==1 && m==1) printf("0"); else if(n==1) printf("%lld",m-1); else if(m==1) printf("%lld",n-1); else { resh = n-1; sum = resh; resv = n*(m-1); sum+=resv; printf("%lld",sum); } return 0; }