import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	}

	private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	}

	private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	}
} Main public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	} main {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int nNum = sc.nextInt(); nNum sc.nextInt() sc.nextInt sc int mNum = sc.nextInt(); mNum sc.nextInt() sc.nextInt sc int nRes = 0; nRes 0 int mRes = 0; mRes 0 if (nNum > 1) {
			nRes = CalcCombi(nNum);
		} nNum > 1 nNum 1 {
			nRes = CalcCombi(nNum);
		} nRes = CalcCombi(nNum) nRes CalcCombi(nNum) CalcCombi nNum if (mNum > 1) {
			mRes = CalcCombi(mNum);
		} mNum > 1 mNum 1 {
			mRes = CalcCombi(mNum);
		} mRes = CalcCombi(mNum) mRes CalcCombi(mNum) CalcCombi mNum System.out.println(nRes + mRes) System.out.println System.out System System.out nRes + mRes nRes mRes String[] args args private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	} CalcCombi {

		return (num * (num - 1) / 2);
	} return (num * (num - 1) / 2); (num * (num - 1) / 2) num * (num - 1) num (num - 1) num 1 2 int num num public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	}

	private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	}
} public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	}

	private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner sc = new Scanner(System.in);

		//値を取得
		int nNum = sc.nextInt();
		int mNum = sc.nextInt();

		//nとmで組み合わせ計算する
		//nの場合
		int nRes = 0;
		int mRes = 0;

		if (nNum > 1) {
			nRes = CalcCombi(nNum);
		}

		if (mNum > 1) {
			mRes = CalcCombi(mNum);
		}

		//結果を足す
		System.out.println(nRes + mRes);
	}

	private static int CalcCombi(int num) {

		return (num * (num - 1) / 2);
	}
}
