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