#include<iostream> using namespace std; int p,q; int main() { scanf("%d%d",&p,&q); cout<<(p-1)*(q-1)-1; return 0; }