#include<bits/stdc++.h>
using namespace std;

using ll = long long;

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

    ll n, m;
    cin >> n >> m;

    if (n == 1 || m == 1) {
        cout << ((n != 1) ? n : m) << "\n";
        return 0;
    }

    int ans = 2 * n + 2 * (m - 2);

    n -= 2; m -= 2;

    ans += (m / 2) * (2 * (n / 2) + (n % 2));
    if (m % 2 == 1) ans += n / 2;

    cout << ans << "\n";

    return 0;
}