import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	} 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 numN = N * (N - 1) / 2; numN N * (N - 1) / 2 N * (N - 1) N (N - 1) N 1 2 int numM = M * (M - 1) / 2; numM M * (M - 1) / 2 M * (M - 1) M (M - 1) M 1 2 int sum = numN + numM; sum numN + numM numN numM System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

} public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

}
