import java.util.Scanner;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

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

} import java.util.Scanner; Scanner java.util import java.util.LinkedList; LinkedList java.util import java.util.PriorityQueue; PriorityQueue java.util import java.util.Queue; Queue 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 m = N*(N-1)/2 + M*(M-1)/2;
		
		System.out.println(m);
		
	}

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

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

} Main
import java.util.Scanner;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

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

}