import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(combination(n,2) + combination(m,2));
	}
	public static long factorial(long n) {
		if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		}
	}
	public static long combination(long n, long r) {
		long top = n;
		for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		}
		long bottom = factorial(r);
		return top / bottom;
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(combination(n,2) + combination(m,2));
	}
	public static long factorial(long n) {
		if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		}
	}
	public static long combination(long n, long r) {
		long top = n;
		for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		}
		long bottom = factorial(r);
		return top / bottom;
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(combination(n,2) + combination(m,2));
	} main {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(combination(n,2) + combination(m,2));
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in System.out.println(combination(n,2) + combination(m,2)) System.out.println System.out System System.out combination(n,2) + combination(m,2) combination(n,2) combination n 2 combination(m,2) combination m 2 String[] args args public static long factorial(long n) {
		if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		}
	} factorial {
		if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		}
	} if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		} n <= 1 n 1 return 1; 1 {
			return n * factorial(n - 1);
		} return n * factorial(n - 1); n * factorial(n - 1) n factorial(n - 1) factorial n - 1 n 1 long n n public static long combination(long n, long r) {
		long top = n;
		for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		}
		long bottom = factorial(r);
		return top / bottom;
	} combination {
		long top = n;
		for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		}
		long bottom = factorial(r);
		return top / bottom;
	} long top = n; top n for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		} int i = 0; int i = 0; i 0 i < r - 1 i r - 1 r 1 i++ i++ i {
			top = top * (--n);
		} {
			top = top * (--n);
		} top = top * (--n) top top * (--n) top (--n) n long bottom = factorial(r); bottom factorial(r) factorial r return top / bottom; top / bottom top bottom long n n long r r
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		System.out.println(combination(n,2) + combination(m,2));
	}
	public static long factorial(long n) {
		if (n <= 1)
			return 1;
		else {
			return n * factorial(n - 1);
		}
	}
	public static long combination(long n, long r) {
		long top = n;
		for (int i = 0; i < r - 1; i++) {
			top = top * (--n);
		}
		long bottom = factorial(r);
		return top / bottom;
	}
}
