import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	} main {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int res = 0; res 0 String result = ""; result "" res = a*(a-1)+b*(b-1) res a*(a-1)+b*(b-1) a*(a-1) a (a-1) a 1 b*(b-1) b (b-1) b 1 res/= 2 res 2 System.out.printf("%d\n", res) System.out.printf System.out System System.out "%d\n" res String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int res = 0;

		String result = "";

		res = a*(a-1)+b*(b-1);
		res/= 2;


		System.out.printf("%d\n", res);
		//System.out.printf("%d", result);
	}
}
