import java.util.*;
class Main {

	public static int getCvalue(int n, int m) {
			if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int res = 0;
		res += getCvalue(n, 2);
		//System.out.println(res);
		res += getCvalue(m, 2);

		System.out.println(res);
	}
} import java.util.*; util.* java class Main {

	public static int getCvalue(int n, int m) {
			if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int res = 0;
		res += getCvalue(n, 2);
		//System.out.println(res);
		res += getCvalue(m, 2);

		System.out.println(res);
	}
} Main public static int getCvalue(int n, int m) {
			if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			}
	} getCvalue {
			if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			}
	} if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			} n < 2 n 2 {
				return 0;
			} return 0; 0 {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			} int k = n - m; k n - m n m int a = 1; a 1 while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				} n > k n k {
					a *= (n--);
					//System.out.println("a " + a);
				} a *= (n--) a (n--) n return a/2; a/2 a 2 int n n int m m public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int res = 0;
		res += getCvalue(n, 2);
		//System.out.println(res);
		res += getCvalue(m, 2);

		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int res = 0;
		res += getCvalue(n, 2);
		//System.out.println(res);
		res += getCvalue(m, 2);

		System.out.println(res);
	} 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 res = 0; res 0 res += getCvalue(n, 2) res getCvalue(n, 2) getCvalue n 2 res += getCvalue(m, 2) res getCvalue(m, 2) getCvalue m 2 System.out.println(res) System.out.println System.out System System.out res String[] args args
import java.util.*;
class Main {

	public static int getCvalue(int n, int m) {
			if(n < 2) {
				return 0;
			}
			else {
				int k = n - m;
				int a = 1;
				while(n > k) {
					a *= (n--);
					//System.out.println("a " + a);
				}
				return a/2;
			}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int res = 0;
		res += getCvalue(n, 2);
		//System.out.println(res);
		res += getCvalue(m, 2);

		System.out.println(res);
	}
}