#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long int n,m; while(scanf("%lld%lld",&n,&m)==2) { if(m==1) { printf("%lld\n",n-1); continue; } /*if(m%2==1) { long long int result=n*m; printf("%lld\n",result-1); continue; }*/ else { long long int result=n*m; printf("%lld\n",result-1); continue; } } return 0; }