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