program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,m

    read*, n,m
    if (n==1 .and. m==1) call ans(1_8)
    if (n==1) call ans(m-2)
    if (m==1) call ans(n-2)
    call ans((n-2)*(m-2))
contains
    subroutine ans(num)
        integer(int64)::num
        print'(i0)',num
        stop
    end subroutine
end program name