import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	}

	static int getnc2(int n) {
		return n * (n - 1) / 2;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	}

	static int getnc2(int n) {
		return n * (n - 1) / 2;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

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

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	} 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 nAmount = getnc2(n); nAmount getnc2(n) getnc2 n int mAmount = getnc2(m); mAmount getnc2(m) getnc2 m System.out.println((nAmount + mAmount)) System.out.println System.out System System.out (nAmount + mAmount) nAmount mAmount String[] args args static int getnc2(int n) {
		return n * (n - 1) / 2;
	} getnc2 {
		return n * (n - 1) / 2;
	} return n * (n - 1) / 2; n * (n - 1) / 2 n * (n - 1) n (n - 1) n 1 2 int n n public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	}

	static int getnc2(int n) {
		return n * (n - 1) / 2;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	}

	static int getnc2(int n) {
		return n * (n - 1) / 2;
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int nAmount = getnc2(n);
		int mAmount = getnc2(m);

		System.out.println((nAmount + mAmount));
	}

	static int getnc2(int n) {
		return n * (n - 1) / 2;
	}
}