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