with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;

procedure Main is
	s:Integer;
    w:Integer;
begin
	get(s);
	get(w);
    put(s*(s-1)/2+w*(w-1)/2);
	new_line;
    
end Main;