n,m=io.read("*n","*n")
if n>4 and m>4 then
    print(n*m-(2*n+2*m-4))
    return
else
    grid={}
    for i=1,n+2 do
        grid[i]={}
        for j=1,m+2 do
            grid[i][j]="x"
        end
    end
    for i=2,n+1 do
        for j=2,m+1 do
            for k=-1,1 do
                for l=-1,1 do
                    if grid[i-k][j-l]=="x" then
                        grid[i-k][j-l]="o"
                    else
                        grid[i-k][j-l]="x"
                    end
                end
            end
        end
    end

    counter=0
    for i=2,n+1 do
        for j=2,m+1 do
            if grid[i][j]=="o" then
                counter=counter+1
            end
        end
    end
    print(counter)
end