#include <bits/stdc++.h>

using namespace std;

unsigned long long n, m, okolo, prvi, drugi;


int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> m;
    n = 1000000000;
    m = 1000000000;
    if (n > 2 && m > 2) {
        okolo = 2 * n + (2 * m - 4);
        prvi = (n-2)/2 * ((m-2)/2+(m%2!=0));
        drugi = ((n-2)/2+(n%2!=0)) * ((m-2)/2);
        cout << okolo + prvi + drugi;
    }
    else cout << n * m;

return 0;
}