#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; cin >> n >> m; long long int a = n - 1; long long int b = m - 1; cout << min(b * n + a, a * m + b) << "\n"; return 0; }