#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define pb push_back
typedef long long ll;

const int nmax=200010;

tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ost;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    if(n==1 || m==1) {
        cout << "0\n";
        return 0;
    }
    assert(0);
    return 0;
}
