#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip> 
#include <map>
#include <string>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <iterator>
#include <queue>
#include <set>


#define f(n) for (long long i = 0; i < n; i++)
#define f0(n) for (int j = 0; j < n; j++)
#define co(n) cout << n << "\n";

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, m;
    cin >> n >> m;
    if (n <= 2 || m <= 2) cout << n * m;
    else
    {
        long long r = 2 * n + 2 * m - 4;
        r += ((n - 2) / 2) * ((m - 1) / 2) + ((n - 1) / 2) * ((m - 2) / 2);
        cout << r;
    }
}