import java.util.*;

class Main {
	Scanner sc;
	int N, M;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		System.out.println( N*(N-1)/2+M*(M-1)/2 );
	}

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

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

class Main {
	Scanner sc;
	int N, M;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		System.out.println( N*(N-1)/2+M*(M-1)/2 );
	}

	public static void main(String[] args) {
		new Main().calc();
	}
}
