//同余方程
#include<iostream>#include<cstdio>using namespace std;int main(){ long long a,b,x; cin>>a>>b; x=a*b-a-b; cout<<x<<endl; return 0;}