import java.util.Scanner; 

class Main{

 public static void main(String[] args){

 Scanner scan = new Scanner(System.in);

 int n = scan.nextInt();
 int m = scan.nextInt();
   
   if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   }
 }
} import java.util.Scanner; Scanner java.util class Main{

 public static void main(String[] args){

 Scanner scan = new Scanner(System.in);

 int n = scan.nextInt();
 int m = scan.nextInt();
   
   if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   }
 }
} Main public static void main(String[] args){

 Scanner scan = new Scanner(System.in);

 int n = scan.nextInt();
 int m = scan.nextInt();
   
   if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   }
 } main {

 Scanner scan = new Scanner(System.in);

 int n = scan.nextInt();
 int m = scan.nextInt();
   
   if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   }
 } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   } n >= 2 || m >=2 n >= 2 n 2 m >=2 m 2 {
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   } int a = n*(n-1)/2; a n*(n-1)/2 n*(n-1) n (n-1) n 1 2 int b = m*(m-1)/2; b m*(m-1)/2 m*(m-1) m (m-1) m 1 2 System.out.println(a+b) System.out.println System.out System System.out a+b a b {
     System.out.println(0);
   } System.out.println(0) System.out.println System.out System System.out 0 String[] args args
import java.util.Scanner; 

class Main{

 public static void main(String[] args){

 Scanner scan = new Scanner(System.in);

 int n = scan.nextInt();
 int m = scan.nextInt();
   
   if (n >= 2 || m >=2 ){
     int a = n*(n-1)/2;
     int b = m*(m-1)/2;
     
      System.out.println(a+b);
   }
   else {
     System.out.println(0);
   }
 }
}