using System;
using System.Linq;
using System.Collections.Generic;

class program
{
    static void Main()
    {
        var NM = Console.ReadLine().Split(' ');

        ulong N = ulong.Parse(NM[0]);
        ulong M = ulong.Parse(NM[1]);
        ulong resenje = 0;
        if(N == 1)
        {
            Console.WriteLine(M);
        }
        else if (M == 1)
        {
            Console.WriteLine(N);
        }
        else
        {

            resenje = (2 * N) + (M - 2) + ((N - 2) * (M - 2)) / 2;
            Console.WriteLine(resenje);
        }
    }
}