import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	} main {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	} 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 gu = (n*(n-1))/2; gu (n*(n-1))/2 (n*(n-1)) n (n-1) n 1 2 int ki = (m*(m-1))/2; ki (m*(m-1))/2 (m*(m-1)) m (m-1) m 1 2 System.out.println(gu+ki) System.out.println System.out System System.out gu+ki gu ki String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list=new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//int[][] array = new int[3][3];
		int n = sc.nextInt();
		int m = sc.nextInt();
		int gu = (n*(n-1))/2;
		int ki = (m*(m-1))/2;
		//System.out.println(gu);
		//System.out.println(ki);
		//System.out.println(4*3/2);
		System.out.println(gu+ki);
	}
}