module A
  sub Main(byval args() as string)
    dim arr() as string =split(console.readline())
    dim n,m,res as integer
    n=arr(0):m=arr(1):res=0
    if n>1 then res += n * (n-1) / 2
    if m>1 then res += m * (m-1) / 2
    console.writeline(res)
  end sub
end module