#include #define ll long long using namespace std; int n, m; int main() { #ifdef wws freopen("in", "r", stdin); #endif // wws cin >> n >> m; ll ans = min(n - 1 + 1ll * n * (m - 1), m - 1 + 1ll * m * (n - 1)); cout << ans << endl; return 0; }