program TNEP
    implicit none
    integer n, m, i, ans
    integer :: r = 2, ansg = 1, ansk = 1
    read *, n, m
    if(n .ge. 2)then
        do i = 1, r
            ansg = ansg*(n - i + 1)/i
        end do
    end if
    if(m .ge. 2)then
        do i = 1, r
            ansk = ansk*(m - i + 1)/i
        end do
    end if
    if(n .ge. 2 .and. m .ge. 2)then
        ans = ansk + ansg
        print *, ans
    else if(n .ge. 2 .and. m .lt. 2)then
        print *, ansg
    else if(n .lt. 2 .and. m .ge. 2)then
        print *, ansk
    else if(n .lt. 2 .and. m .lt. 2)then
        print *, 0
    end if
end program