import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Nans = combination(N);
        int Mans = combination(M);

		System.out.println(Nans + Mans);
	}
	public static int combination(int num){
        int ans = (num * (num - 1)) / 2;
		return ans;
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Nans = combination(N);
        int Mans = combination(M);

		System.out.println(Nans + Mans);
	}
	public static int combination(int num){
        int ans = (num * (num - 1)) / 2;
		return ans;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Nans = combination(N);
        int Mans = combination(M);

		System.out.println(Nans + Mans);
	} main {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Nans = combination(N);
        int Mans = combination(M);

		System.out.println(Nans + Mans);
	} 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 Nans = combination(N); Nans combination(N) combination N int Mans = combination(M); Mans combination(M) combination M System.out.println(Nans + Mans) System.out.println System.out System System.out Nans + Mans Nans Mans String[] args args public static int combination(int num){
        int ans = (num * (num - 1)) / 2;
		return ans;
	} combination {
        int ans = (num * (num - 1)) / 2;
		return ans;
	} int ans = (num * (num - 1)) / 2; ans (num * (num - 1)) / 2 (num * (num - 1)) num (num - 1) num 1 2 return ans; ans int num num
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int Nans = combination(N);
        int Mans = combination(M);

		System.out.println(Nans + Mans);
	}
	public static int combination(int num){
        int ans = (num * (num - 1)) / 2;
		return ans;
	}
}