module practiceA
  sub Main(ByVal args() as String)
    	Dim arr(2) as string
    	arr=Split(Console.ReadLine())
    	Dim N As Integer = arr(0)
    
        Dim M As Integer = arr(1)
        Dim x As Integer = 0
        Dim kekka As Integer = 0
        Dim i As Integer

        For i = 1 To N
            x = (N - i)
            kekka = x + kekka
        Next

        For i = 1 To M
            x = (M - i)
            kekka = x + kekka
        Next

Console.WriteLine(kekka)

  end sub
end module