program main
    implicit none
    integer n,m,number
    read(*,*) n, m
    number = 0
    if (n > 1) then
        number = n*(n-1)/2
    end if
    if (m > 1) then
        number = number + m*(m-1)/2
    end if
    write(*,*) number

end program