import java.util.Scanner;

public class Main {

	public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	}

} Main public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int nm = n + m; nm n + m n m System.out.println(nm * (nm - 1) / 2 - n * m) System.out.println System.out System System.out nm * (nm - 1) / 2 - n * m nm * (nm - 1) / 2 nm * (nm - 1) nm (nm - 1) nm 1 2 n * m n m String... nui nui public class Main {

	public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	}

} public class Main {

	public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String... nui) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt(), m = sc.nextInt();
		
		int nm = n + m;
		
		System.out.println(nm * (nm - 1) / 2 - n * m);
		
	}

}