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