//package atcoder;
 
import java.util.*;
 
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	} 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 gugu = N*(N-1)/2; gugu N*(N-1)/2 N*(N-1) N (N-1) N 1 2 int kiki = M*(M-1)/2; kiki M*(M-1)/2 M*(M-1) M (M-1) M 1 2 System.out.println(gugu+kiki) System.out.println System.out System System.out gugu+kiki gugu kiki String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	}
} Main
//package atcoder;
 
import java.util.*;
 
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int gugu = N*(N-1)/2;
		int kiki = M*(M-1)/2;
		
		System.out.println(gugu+kiki);
	}
}