using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

internal class Program
{
    static void Main(string[] args)
    {
        string[] ulaz = Console.ReadLine().Split();
        int m = Convert.ToInt32(ulaz[0]);
        int n = Convert.ToInt32(ulaz[1]);

        long okvir = (m + n) * 2 - 4;
        long proizvod = m * n;

        if (m <= 2 || n <= 2) Console.WriteLine(proizvod);
        else Console.WriteLine(okvir + (proizvod - okvir) / 2);
    }
}