import java.util.Scanner;
public class Main
{
 	public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    }
  
} import java.util.Scanner; Scanner java.util public class Main
{
 	public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    }
  
} Main public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    } main {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] sep = sc.nextLine().split(" "); sep sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int n = Integer.parseInt(sep[0]); n Integer.parseInt(sep[0]) Integer.parseInt Integer sep[0] sep 0 int m = Integer.parseInt(sep[1]); m Integer.parseInt(sep[1]) Integer.parseInt Integer sep[1] sep 1 System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 ) System.out.println System.out System System.out n * (n - 1) / 2 + m * (m - 1) / 2 n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 m * (m - 1) / 2 m * (m - 1) m (m - 1) m 1 2 String[] args args public class Main
{
 	public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    }
  
} public class Main
{
 	public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    }
  
} Main
import java.util.Scanner;
public class Main
{
 	public static void main(String[] args)
    {
     	 Scanner sc = new Scanner(System.in);
      	String[] sep = sc.nextLine().split(" ");
      	int n = Integer.parseInt(sep[0]); 
  		int m = Integer.parseInt(sep[1]);
  		System.out.println( n * (n - 1) / 2 + m * (m - 1) / 2 );
    }
  
}