import java.util.Scanner;

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

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	}
	public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	}
	public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int ans = com(n, 2) + com(m, 2); ans com(n, 2) + com(m, 2) com(n, 2) com n 2 com(m, 2) com m 2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	} com {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	} if(a < b)
			return 0; a < b a b return 0; 0 int res; res res = 1 res 1 int i; i for(i = 0; i < b; i++) {
			res = res * (a - i);
		} i = 0; i = 0 i 0 i < b i b i++ i++ i {
			res = res * (a - i);
		} {
			res = res * (a - i);
		} res = res * (a - i) res res * (a - i) res (a - i) a i for(i = 1; i <= b; i++) {
			res = res / i;
		} i = 1; i = 1 i 1 i <= b i b i++ i++ i {
			res = res / i;
		} {
			res = res / i;
		} res = res / i res res / i res i return res; res int a a int b b public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	}
	public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

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

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	}
	public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	}
} Main
import java.util.Scanner;

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

		int ans = com(n, 2) + com(m, 2);

		System.out.println(ans);

	}
	public static int com(int a, int b) {
		if(a < b)
			return 0;

		int res;

		res = 1;
		int i;
		for(i = 0; i < b; i++) {
			res = res * (a - i);
		}
		for(i = 1; i <= b; i++) {
			res = res / i;
		}

		return res;
	}
}