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

namespace Takmicenje2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int x = int.Parse(s.Split(' ')[0]);
            int y = int.Parse(s.Split(' ')[1]);
            int k = 0;
            int p = 0;
            int r = 0;
            int rez = 0;
            k = (x * 2 + y * 2) - 4;
            p = (x * y) - ((x * 2 + y * 2) - 4);
            r = p / 2;
            rez = r + k;
            if(x == 1)
                Console.WriteLine(y);
            else if (y == 1)
                Console.WriteLine(x);
            else Console.WriteLine(rez);

        }
    }
}