#include #include #include #include #include using namespace std; long long int count_cut(long long int m,long long int n) { if(m==1) { return n-1; } else if(n==1) { return m-1; } else { if(n>m) { return m-1+(m*count_cut(n,1)); } else { return n-1+(n*count_cut(1,m)); } } } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long int n,m; cin>>n; cin>>m; long long int min=n,cut=0; long long int res=0; res=count_cut(n,m); cout<