import java.util.*;
class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int m = sc.nextInt();
    
    int nn = (n*(n-1))/2;
    int mn = (m*(m-1))/2;
    
    System.out.println(nn+mn);
  }
} import java.util.*; util.* java class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int m = sc.nextInt();
    
    int nn = (n*(n-1))/2;
    int mn = (m*(m-1))/2;
    
    System.out.println(nn+mn);
  }
} Main public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int m = sc.nextInt();
    
    int nn = (n*(n-1))/2;
    int mn = (m*(m-1))/2;
    
    System.out.println(nn+mn);
  } main {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int m = sc.nextInt();
    
    int nn = (n*(n-1))/2;
    int mn = (m*(m-1))/2;
    
    System.out.println(nn+mn);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int nn = (n*(n-1))/2; nn (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 int mn = (m*(m-1))/2; mn (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 System.out.println(nn+mn) System.out.println System.out System System.out nn+mn nn mn String[] args args
import java.util.*;
class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int m = sc.nextInt();
    
    int nn = (n*(n-1))/2;
    int mn = (m*(m-1))/2;
    
    System.out.println(nn+mn);
  }
}